Skip to main content

Module wait

Module wait 

Source
Expand description

Wait trait and built-in wait strategies.

Wait strategies determine the delay between retry attempts. They compose with + or .add(), and chain via .chain().

Structs§

Jittered
Applies jitter to an inner wait strategy’s output.
WaitCapped
Clamps an inner wait strategy’s output to a maximum duration.
WaitChain
A strategy that uses one wait strategy for the first after attempts, then switches to another.
WaitCombine
Composite strategy that returns the sum of two strategies’ outputs.
WaitDecorrelatedJitter
A standalone jitter strategy where each delay is random between base and three times the previous delay.
WaitExponential
An exponentially increasing wait strategy.
WaitFixed
A wait strategy that returns the same duration on every attempt.
WaitLinear
A linearly increasing wait strategy.

Traits§

Wait
Computes the delay duration between retry attempts.

Functions§

decorrelated_jitter
Produces a decorrelated jitter strategy: random(base, last_sleep * 3).
exponential
Produces an exponentially increasing strategy: initial * 2^(n-1).
fixed
linear