pub fn exponential_backoff(
attempt: u32,
base_delay_ms: u64,
max_delay_ms: u64,
jitter: bool,
) -> DurationExpand description
Calculate exponential backoff delay with optional jitter.
§Arguments
attempt- The retry attempt number (0-indexed)base_delay_ms- The base delay in millisecondsmax_delay_ms- The maximum delay in millisecondsjitter- Whether to add random jitter (0-100% of calculated delay)
§Returns
The delay duration to wait before the next retry