public class RpcClientFuture extends Object implements Future<RpcPacket.ResponsePacket>, RpcDone, Recyclable
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
SPIN_LOCK_COUNT |
static LongAdder |
TOTAL_COUNT
Total number of calls
|
static LongAdder |
TOTAL_SUCCESS_COUNT |
| 构造器和说明 |
|---|
RpcClientFuture() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
cancel
|
void |
done(RpcPacket.ResponsePacket rpcResponse)
Has been completed
|
void |
doneTimeout(int requestId,
long createTimestamp,
long expiryTimestamp)
on timeout
|
RpcPacket.ResponsePacket |
get() |
RpcPacket.ResponsePacket |
get(long timeout,
TimeUnit timeUnit)
Get (note: block the current thread)
|
RpcPacket.ResponsePacket |
getResult() |
boolean |
isCancelled() |
boolean |
isDone() |
static RpcClientFuture |
newInstance(RpcContext<RpcClient> rpcContext) |
void |
recycle()
recycle
|
String |
toString() |
handlerResponseIfNeedThrowrecyclepublic static final LongAdder TOTAL_COUNT
public static final LongAdder TOTAL_SUCCESS_COUNT
public static int SPIN_LOCK_COUNT
public static RpcClientFuture newInstance(RpcContext<RpcClient> rpcContext)
public RpcPacket.ResponsePacket get() throws InterruptedException
get 在接口中 Future<RpcPacket.ResponsePacket>InterruptedExceptionpublic RpcPacket.ResponsePacket get(long timeout, TimeUnit timeUnit) throws InterruptedException
get 在接口中 Future<RpcPacket.ResponsePacket>timeout - timeouttimeUnit - timeUnitInterruptedExceptionpublic boolean cancel(boolean mayInterruptIfRunning)
cancel 在接口中 Future<RpcPacket.ResponsePacket>public boolean isCancelled()
isCancelled 在接口中 Future<RpcPacket.ResponsePacket>public boolean isDone()
isDone 在接口中 Future<RpcPacket.ResponsePacket>public RpcPacket.ResponsePacket getResult()
public void done(RpcPacket.ResponsePacket rpcResponse)
public void doneTimeout(int requestId,
long createTimestamp,
long expiryTimestamp)
RpcDonedoneTimeout 在接口中 RpcDonerequestId - requestIdcreateTimestamp - createTimestampexpiryTimestamp - expiryTimestamppublic void recycle()
Recyclablerecycle 在接口中 RecyclableCopyright © 2021. All rights reserved.