ExponentialBackoffWithJitter

A DelayProvider that implements exponentially increasing delays and jitter (i.e., randomization of delay amount). This delayer calculates a maximum delay time from the initial delay amount, the scale factor, and the attempt number. It then randomly reduces that time down to something less based on the jitter configuration.

For instance, a jitter configuration of 0.5 means that up to 50% of the max delay time could be reduced. A jitter configuration of 1.0 means that 100% of the max delay time could be reduced (potentially down to 0). A jitter configuration of 0.0 means jitter is disabled.

Parameters

config

The configuration to use for this delayer.

Constructors

Link copied to clipboard
constructor(config: ExponentialBackoffWithJitter.Config = Config.Default)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun backoff(attempt: Int)

Delays for an appropriate amount of time after the given attempt number.