RetryToken

interface RetryToken

A token from a RetryTokenBucket. This token grants the holder the right to attempt a try/retry of a block of code. The token is effectively "borrowed" from the token bucket and must be returned when the retry attempt is completed, either by calling notifySuccess or scheduleRetry.

Functions

Link copied to clipboard
abstract suspend fun notifyFailure()

Completes this token because retrying has been abandoned.

Link copied to clipboard
abstract suspend fun notifySuccess()

Completes this token because the previous retry attempt was successful.

Link copied to clipboard
abstract suspend fun scheduleRetry(reason: RetryErrorType): RetryToken

Completes this token and requests another one because the previous retry attempt was unsuccessful.