T - Type of Responsepublic class AsyncRpcRetryingCaller<T>
extends java.lang.Object
AsyncRetryingCallable. Sets into rpc client
threadlocal outstanding timeouts as so we don't persist too much.
Dynamic rather than static so can set the generic appropriately.| Constructor and Description |
|---|
AsyncRpcRetryingCaller(long pause,
int retries)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
callWithoutRetries(AsyncRetryingCallable<T> callable,
int callTimeout,
ResponseHandler<T> handler)
Call the server once only.
|
void |
callWithRetries(AsyncRetryingCallable<T> callable,
int callTimeout,
ResponseHandler<T> handler)
Retries if invocation fails.
|
void |
callWithRetries(AsyncRetryingCallable<T> callable,
ResponseHandler<T> handler)
Retries if invocation fails.
|
public AsyncRpcRetryingCaller(long pause,
int retries)
pause - before retryretries - max amount of retriespublic void callWithRetries(AsyncRetryingCallable<T> callable, ResponseHandler<T> handler)
callable - to runhandler - to handle responsepublic void callWithRetries(AsyncRetryingCallable<T> callable, int callTimeout, ResponseHandler<T> handler)
callTimeout - Timeout for this callhandler - to handle responsecallable - The AsyncRetryingCallable to run.public void callWithoutRetries(AsyncRetryingCallable<T> callable, int callTimeout, ResponseHandler<T> handler)
AsyncRetryingCallable has a strange shape so we can do retries. Use this invocation if you
want to do a single call only (A call to AsyncRetryingCallable.call(ResponseHandler) will not likely
succeed).callable - to callcallTimeout - to timeout callhandler - for response