shouldRetry

fun shouldRetry(failure: AnalyzedFailure, attemptIndex: Int): Boolean

Returns true if the policy decides to retry after this particular failure.

Parameters

attemptIndex

0-based count of failures so far (i.e. number of retries already performed). The next retry would be attemptIndex + 1; we retry only while attemptIndex < maxAttempts.