LinearRetry

class LinearRetry(firstBackoff: Duration, maxBackoff: Duration, maxTries: Int) : Retry(source)

A Retry that linearly increases the delay time between a given minimum and maximum over a given amount of tries.

Parameters

firstBackoff

the initial delay for a retry invocation.

maxBackoff

the maximum delay for a retry invocation.

maxTries

the maximum amount of consecutive retries before hasNext returns false.

Constructors

Link copied to clipboard
constructor(firstBackoff: Duration, maxBackoff: Duration, maxTries: Int)

Properties

Link copied to clipboard
open override val hasNext: Boolean

Whether this strategy has any more retries left.

Functions

Link copied to clipboard
open override fun reset()

Resets the underlying retry counter if this Retry uses an maximum for consecutive retry invocations. This should be called after a successful retry.

Link copied to clipboard
open suspend override fun retry()

Suspends for a certain amount of time.