Expand description
§Backoff
Backoff provides the base components for implementing backoff and retry operations.
use backoff_rs::ExponentialBackoffBuilder;
use std::time::Duration;
fn main() {
let bo = ExponentialBackoffBuilder::default()
.factor(1.75)
.interval(Duration::from_millis(500))
.jitter(Duration::from_millis(150))
.max(Duration::from_secs(5))
.build();
for attempt in 0..=5 {
println!("{:?}", bo.duration(attempt));
}
}
Structs§
- Exponential
- An Exponential Backoff instance for calculating backoff durations.
- Exponential
Backoff Builder - Configures an ExponentialBackoff instance for use.