Skip to main content

backoff

Function backoff 

Source
pub fn backoff(
    policy: &RetryPolicy,
    attempt: u32,
    retry_after: Option<Duration>,
) -> Duration
Expand description

Compute the pre-retry sleep for attempt (1-based). Retry-After takes precedence and bypasses the exponential cap (itself capped); otherwise exponential with ±10% jitter.