public class RpcFuture<T> extends Object implements AsyncAwareFuture<T>
| Modifier and Type | Field and Description |
|---|---|
protected RpcCallback<T> |
callback |
protected ChannelInfo |
channelInfo |
protected ChannelType |
channelType |
protected long |
correlationId |
protected long |
endTime |
protected List<Interceptor> |
interceptors |
protected boolean |
isDone |
protected CountDownLatch |
latch |
protected Request |
request |
protected Response |
response |
protected RpcMethodInfo |
rpcMethodInfo |
protected long |
startTime |
protected io.netty.util.Timeout |
timeout |
| Constructor and Description |
|---|
RpcFuture() |
RpcFuture(long correlationId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
static RpcFuture |
createRpcFuture(Request request) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
void |
handleConnection(Response response) |
void |
handleResponse(Response response) |
void |
init(io.netty.util.Timeout timeout,
RpcMethodInfo rpcMethodInfo,
RpcCallback<T> callback,
ChannelInfo channelInfo) |
boolean |
isAsync() |
boolean |
isCancelled() |
boolean |
isDone() |
protected void |
setRpcContext() |
String |
toString() |
protected CountDownLatch latch
protected io.netty.util.Timeout timeout
protected Request request
protected RpcCallback<T> callback
protected ChannelInfo channelInfo
protected ChannelType channelType
protected RpcMethodInfo rpcMethodInfo
protected Response response
protected boolean isDone
protected long startTime
protected long endTime
protected volatile long correlationId
protected List<Interceptor> interceptors
public void init(io.netty.util.Timeout timeout,
RpcMethodInfo rpcMethodInfo,
RpcCallback<T> callback,
ChannelInfo channelInfo)
public void handleConnection(Response response)
public void handleResponse(Response response)
public boolean isAsync()
isAsync in interface AsyncAwareFuture<T>public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException
get in interface Future<T>InterruptedExceptionprotected void setRpcContext()
Copyright © 2022 Baidu, Inc.. All rights reserved.