public final class RetryingRpcClient extends AbstractRetryingClient<RpcRequest,RpcResponse> implements RpcClient
RpcClient decorator that handles failures of an invocation and retries RPC requests.ARMERIA_RETRY_COUNT| Modifier and Type | Method and Description |
|---|---|
static RetryingRpcClientBuilder |
builder(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent)
Returns a new
RetryingRpcClientBuilder with the specified RetryStrategyWithContent. |
protected RpcResponse |
doExecute(ClientRequestContext ctx,
RpcRequest req)
Invoked by
AbstractRetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set. |
static Function<? super RpcClient,RetryingRpcClient> |
newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent)
Creates a new
RpcClient decorator that handles failures of an invocation and retries
RPC requests. |
static Function<? super RpcClient,RetryingRpcClient> |
newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent,
int maxTotalAttempts)
Creates a new
RpcClient decorator that handles failures of an invocation and retries
RPC requests. |
static Function<? super RpcClient,RetryingRpcClient> |
newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent,
int maxTotalAttempts,
long responseTimeoutMillisForEachAttempt)
Creates a new
RpcClient decorator that handles failures of an invocation and retries
RPC requests. |
execute, getNextDelay, getNextDelay, getTotalAttempts, newDerivedContext, onRetryingComplete, retryStrategy, retryStrategyWithContent, scheduleNextRetry, setResponseTimeoutas, delegate, toStringpublic static Function<? super RpcClient,RetryingRpcClient> newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent)
RpcClient decorator that handles failures of an invocation and retries
RPC requests.retryStrategyWithContent - the retry strategypublic static Function<? super RpcClient,RetryingRpcClient> newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent, int maxTotalAttempts)
RpcClient decorator that handles failures of an invocation and retries
RPC requests.retryStrategyWithContent - the retry strategymaxTotalAttempts - the maximum number of total attemptspublic static Function<? super RpcClient,RetryingRpcClient> newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent, int maxTotalAttempts, long responseTimeoutMillisForEachAttempt)
RpcClient decorator that handles failures of an invocation and retries
RPC requests.retryStrategyWithContent - the retry strategymaxTotalAttempts - the maximum number of total attemptsresponseTimeoutMillisForEachAttempt - response timeout for each attempt. 0 disables
the timeoutpublic static RetryingRpcClientBuilder builder(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent)
RetryingRpcClientBuilder with the specified RetryStrategyWithContent.protected RpcResponse doExecute(ClientRequestContext ctx, RpcRequest req) throws Exception
AbstractRetryingClientAbstractRetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set.doExecute in class AbstractRetryingClient<RpcRequest,RpcResponse>ExceptionCopyright © 2020 LeanCloud. All rights reserved.