Skip to main content

compute_delay

Function compute_delay 

Source
pub fn compute_delay(config: &RetryConfig, attempt: u32) -> Duration
Expand description

Computes the delay for a given attempt using the config’s jitter strategy.

§Formula

base = min(initial_delay_ms * multiplier^attempt, max_delay_ms)
delay = apply_jitter(base, jitter_kind)