Interface ResultRetryAlgorithm<ResponseT> (2.46.1)

public interface ResultRetryAlgorithm<ResponseT>

Same as ResultRetryAlgorithmWithContext, but without methods that accept a RetryingContext. Use ResultRetryAlgorithmWithContext instead of this interface when possible.

Type Parameter

NameDescription
ResponseT

Methods

createNextAttempt(Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings)

public abstract TimedAttemptSettings createNextAttempt(Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings)

Same as ResultRetryAlgorithmWithContext#createNextAttempt(RetryingContext, Throwable, Object, TimedAttemptSettings), but without a RetryingContext.

Use ResultRetryAlgorithmWithContext#createNextAttempt(RetryingContext, Throwable, Object, TimedAttemptSettings) instead of this method when possible.

Parameters
NameDescription
prevThrowableThrowable
prevResponseResponseT
prevSettingsTimedAttemptSettings
Returns
TypeDescription
TimedAttemptSettings

shouldRetry(Throwable prevThrowable, ResponseT prevResponse)

public abstract boolean shouldRetry(Throwable prevThrowable, ResponseT prevResponse)
Parameters
NameDescription
prevThrowableThrowable
prevResponseResponseT
Returns
TypeDescription
boolean
Exceptions
TypeDescription
CancellationException