public final class RetryingHttpClient extends RetryingClient<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 RetryingHttpClientBuilder |
builder(RetryStrategy retryStrategy)
Returns a new
RetryingHttpClientBuilder with the specified RetryStrategy. |
static RetryingHttpClientBuilder |
builder(RetryStrategyWithContent<HttpResponse> retryStrategyWithContent)
Returns a new
RetryingHttpClientBuilder with the specified RetryStrategyWithContent. |
protected HttpResponse |
doExecute(ClientRequestContext ctx,
HttpRequest req)
Invoked by
RetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set. |
static Function<? super HttpClient,RetryingHttpClient> |
newDecorator(RetryStrategy retryStrategy)
Creates a new
HttpClient decorator that handles failures of an invocation and retries HTTP
requests. |
static Function<? super HttpClient,RetryingHttpClient> |
newDecorator(RetryStrategy retryStrategy,
int maxTotalAttempts)
Creates a new
HttpClient decorator that handles failures of an invocation and retries HTTP
requests. |
static Function<? super HttpClient,RetryingHttpClient> |
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 RetryingHttpClientBuilder builder(RetryStrategy retryStrategy)
RetryingHttpClientBuilder with the specified RetryStrategy.public static RetryingHttpClientBuilder builder(RetryStrategyWithContent<HttpResponse> retryStrategyWithContent)
RetryingHttpClientBuilder with the specified RetryStrategyWithContent.public static Function<? super HttpClient,RetryingHttpClient> newDecorator(RetryStrategy retryStrategy)
HttpClient decorator that handles failures of an invocation and retries HTTP
requests.retryStrategy - the retry strategypublic static Function<? super HttpClient,RetryingHttpClient> 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,RetryingHttpClient> 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
RetryingClientRetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set.doExecute in class RetryingClient<HttpRequest,HttpResponse>ExceptionCopyright © 2020 LeanCloud. All rights reserved.