Skip to main content

Module policy

Module policy 

Source
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§

RetryPolicy
Bounds on a retry sequence.

Enums§

GiveUpReason
Why a retry sequence stopped.
RetryDecision
The outcome of consulting the policy after a failed attempt.

Functions§

decide
Decide what to do after attempt attempts 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].