DelayStrategy

fun interface DelayStrategy(source)

Interface that computes the delay between retries.

Inheritors

Types

Link copied to clipboard
class ExponentialBackoffDelayStrategy(initialDelay: Duration, factor: Double, maxDelay: Duration) : DelayStrategy

Delay strategy that increases the delay duration exponentially until a max duration has been reached.

Link copied to clipboard

Fixed delay strategy, always returns constant delay for any cause and any attempt.

Link copied to clipboard

A delay strategy that doesn't introduce any delay between attempts. Always returns Duration.ZERO for any cause and any attempt.

Functions

Link copied to clipboard
abstract fun nextDelay(cause: Throwable, attempt: Long): Duration

Returns the Duration computed by this DelayStrategy to delay. Duration.ZERO means passing without delay.