ResponseT - response typepublic interface ResultRetryAlgorithm<ResponseT>
Future will be
canceled.
TimedAttemptSettings for each subsequent retry attempt.
| Modifier and Type | Method and Description |
|---|---|
TimedAttemptSettings |
createNextAttempt(Throwable prevThrowable,
ResponseT prevResponse,
TimedAttemptSettings prevSettings)
Creates a next attempt
TimedAttemptSettings. |
boolean |
shouldRetry(Throwable prevThrowable,
ResponseT prevResponse)
Returns
true if another attempt should be made, or false otherwise. |
TimedAttemptSettings createNextAttempt(Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings)
TimedAttemptSettings.prevThrowable - exception thrown by the previous attempt (null, if none)prevResponse - response returned by the previous attemptprevSettings - previous attempt settingsnull, if the implementing algorithm does not provide
specific settings for the next attemptboolean shouldRetry(Throwable prevThrowable, ResponseT prevResponse) throws CancellationException
true if another attempt should be made, or false otherwise.prevThrowable - exception thrown by the previous attempt (null, if none)prevResponse - response returned by the previous attemptCancellationException - if the retrying process should be canceled