Companion

object Companion

Properties

Link copied to clipboard

No retries: every failure dead-letters immediately.

Functions

Link copied to clipboard
fun exponential(base: Duration = 10.seconds, factor: Double = 2.0, maxAttempts: Int = 8, jitter: Double = 0.2, max: Duration = 1.hours, random: Random = Random.Default): RetryPolicy

Exponential backoff with multiplicative jitter. Delay for attempt n is base * factor^(n-1), capped at max, then scaled by a random factor in [1 - jitter, 1 + jitter]. Gives up after maxAttempts attempts.

Link copied to clipboard

Explicit interval list: attempt n waits delays[n - 1], and the job dead-letters once the list is exhausted. intervals(listOf(30.seconds, 2.minutes, 10.minutes)) means up to 4 attempts total. Takes a List because Kotlin prohibits vararg parameters of value-class types such as Duration.