channel = channelPool.borrowObject();
ListenableFuture<T> response = transform(channel, new AsyncFunction<NettyRpcChannel, T>() {
@Override
public ListenableFuture<T> apply(NettyRpcChannel channel) throws Exception {
RaftProto.RaftService.Stub stub = RaftProto.RaftService.newStub(channel);
ClientController controller = new ClientController(channel);
controller.setTimeout(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
RpcHandlerFuture<T> responseHandler = new RpcHandlerFuture<T>(controller);
call.call(stub, controller, responseHandler);
return responseHandler;
}
});