Interface ResultRetryAlgorithm<ResponseT> (2.54.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

Name Description
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
Name Description
prevThrowable Throwable
prevResponse ResponseT
prevSettings TimedAttemptSettings
Returns
Type Description
TimedAttemptSettings

shouldRetry(Throwable prevThrowable, ResponseT prevResponse)

public abstract boolean shouldRetry(Throwable prevThrowable, ResponseT prevResponse)
Parameters
Name Description
prevThrowable Throwable
prevResponse ResponseT
Returns
Type Description
boolean
Exceptions
Type Description
CancellationException