public class RetryingClient extends AbstractRetryingClient<HttpRequest,HttpResponse> implements HttpClient
HttpClient decorator that handles failures of an invocation and retries HTTP requests.ARMERIA_RETRY_COUNT| Modifier and Type | Method and Description |
|---|---|
static RetryingClientBuilder |
builder(RetryStrategy retryStrategy)
Returns a new
RetryingClientBuilder with the specified RetryStrategy. |
static RetryingClientBuilder |
builder(RetryStrategyWithContent<HttpResponse> retryStrategyWithContent)
Returns a new
RetryingClientBuilder with the specified RetryStrategyWithContent. |
protected HttpResponse |
doExecute(ClientRequestContext ctx,
HttpRequest req)
Invoked by
AbstractRetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set. |
static Function<? super HttpClient,RetryingClient> |
newDecorator(RetryStrategy retryStrategy)
Creates a new
HttpClient decorator that handles failures of an invocation and retries HTTP
requests. |
static Function<? super HttpClient,RetryingClient> |
newDecorator(RetryStrategy retryStrategy,
int maxTotalAttempts)
Creates a new
HttpClient decorator that handles failures of an invocation and retries HTTP
requests. |
static Function<? super HttpClient,RetryingClient> |
newDecorator(RetryStrategy retryStrategy,
int maxTotalAttempts,
long responseTimeoutMillisForEachAttempt)
Creates a new
HttpClient decorator that handles failures of an invocation and retries HTTP
requests. |
execute, getNextDelay, getNextDelay, getTotalAttempts, newDerivedContext, onRetryingComplete, retryStrategy, retryStrategyWithContent, scheduleNextRetry, setResponseTimeoutas, delegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexecutepublic static RetryingClientBuilder builder(RetryStrategy retryStrategy)
RetryingClientBuilder with the specified RetryStrategy.public static RetryingClientBuilder builder(RetryStrategyWithContent<HttpResponse> retryStrategyWithContent)
RetryingClientBuilder with the specified RetryStrategyWithContent.public static Function<? super HttpClient,RetryingClient> newDecorator(RetryStrategy retryStrategy)
HttpClient decorator that handles failures of an invocation and retries HTTP
requests.retryStrategy - the retry strategypublic static Function<? super HttpClient,RetryingClient> newDecorator(RetryStrategy retryStrategy, int maxTotalAttempts)
HttpClient decorator that handles failures of an invocation and retries HTTP
requests.retryStrategy - the retry strategymaxTotalAttempts - the maximum number of total attemptspublic static Function<? super HttpClient,RetryingClient> newDecorator(RetryStrategy retryStrategy, int maxTotalAttempts, long responseTimeoutMillisForEachAttempt)
HttpClient decorator that handles failures of an invocation and retries HTTP
requests.retryStrategy - the retry strategymaxTotalAttempts - the maximum number of total attemptsresponseTimeoutMillisForEachAttempt - response timeout for each attempt. 0 disables
the timeoutprotected HttpResponse doExecute(ClientRequestContext ctx, HttpRequest req) throws Exception
AbstractRetryingClientAbstractRetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set.doExecute in class AbstractRetryingClient<HttpRequest,HttpResponse>ExceptionCopyright © 2020 LeanCloud. All rights reserved.