RetryPolicy

open class RetryPolicy(retryPredicate: RetryPredicate = onException, delayStrategy: DelayStrategy = noDelay)

Represents a retry policy that combines a RetryPredicate and a DelayStrategy.

Since

1.0.0

Parameters

retryPredicate

The RetryPredicate used to evaluate whether a retry should be performed.

delayStrategy

The DelayStrategy used to determine the delay before a retry is attempted.

Constructors

Link copied to clipboard
constructor(retryPredicate: RetryPredicate = onException, delayStrategy: DelayStrategy = noDelay)

Creates a new RetryPolicy with the specified RetryPredicate and DelayStrategy delegates.

Functions

Link copied to clipboard
suspend fun <T> retry(clock: TimeSource = TimeSource.Monotonic, block: RetryBlock<T>): T

Retries the given block using this RetryPolicy