use of com.baidu.hugegraph.computer.core.network.session.ClientSession in project hugegraph-computer by hugegraph.
the class SenderIntegrateTest method slowSendFunc.
private void slowSendFunc(WorkerService service) throws TransportException {
Managers managers = Whitebox.getInternalState(service, "managers");
DataClientManager clientManager = managers.get(DataClientManager.NAME);
ConnectionManager connManager = Whitebox.getInternalState(clientManager, "connManager");
NettyTransportClient client = (NettyTransportClient) connManager.getOrCreateClient("127.0.0.1", 8091);
ClientSession clientSession = Whitebox.invoke(client.getClass(), "clientSession", client);
Function<Message, Future<Void>> sendFuncBak = Whitebox.getInternalState(clientSession, "sendFunction");
Function<Message, Future<Void>> sendFunc = message -> {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
return sendFuncBak.apply(message);
};
Whitebox.setInternalState(clientSession, "sendFunction", sendFunc);
}
Aggregations