Expand description
Pure backoff policy — no clock, no randomness source, no I/O.
decide is a total function of its arguments: the caller owns the clock
(passing elapsed) and the randomness (passing jitter_unit), so every
backoff assertion in the test suite is exact and no test ever sleeps.
Execution lives in the adapter layers that call this.
Structs§
- Retry
Policy - Bounds on a retry sequence.
Enums§
- Give
UpReason - Why a retry sequence stopped.
- Retry
Decision - The outcome of consulting the policy after a failed attempt.
Functions§
- decide
- Decide what to do after
attemptattempts have failed. - duration_
ms 🔒 - Saturating millisecond view of a duration.
- full_
jitter 🔒 - Full jitter over an exponentially growing, capped window.
- honour_
server_ 🔒hint - Server hint as a floor, clamped to
max_backoff, plus decorrelating jitter. - scale 🔒
- Multiply a duration by a unit fraction, clamping the fraction to
[0.0, 1.0].