ResponseT - response typepublic interface ResultRetryAlgorithmWithContext<ResponseT> extends ResultRetryAlgorithm<ResponseT>
Future will be
canceled.
TimedAttemptSettings for each subsequent retry attempt.
RetryingContext that can contain specific
RetrySettings and retryable codes that should be used to determine the retry behavior.
Implementations of this interface must be thread-safe.
| Modifier and Type | Method and Description |
|---|---|
TimedAttemptSettings |
createNextAttempt(RetryingContext context,
Throwable previousThrowable,
ResponseT previousResponse,
TimedAttemptSettings previousSettings)
Creates a next attempt
TimedAttemptSettings. |
boolean |
shouldRetry(RetryingContext context,
Throwable previousThrowable,
ResponseT previousResponse)
Returns
true if another attempt should be made, or false otherwise. |
createNextAttempt, shouldRetryTimedAttemptSettings createNextAttempt(RetryingContext context, Throwable previousThrowable, ResponseT previousResponse, TimedAttemptSettings previousSettings)
TimedAttemptSettings.context - the retrying context of this invocation that can be used to determine the
settings for the next attempt.previousThrowable - exception thrown by the previous attempt (null, if none)previousResponse - response returned by the previous attemptpreviousSettings - previous attempt settingsboolean shouldRetry(RetryingContext context, Throwable previousThrowable, ResponseT previousResponse) throws CancellationException
true if another attempt should be made, or false otherwise.context - the retrying context of this invocation that can be used to determine whether
the call should be retried.previousThrowable - exception thrown by the previous attempt (null, if none)previousResponse - response returned by the previous attempt.CancellationException