#backoff #exponential

backoff-rs

Backoff provides the base components for implementing backoff and retry operations

1 unstable release

0.1.0 Aug 19, 2021

#4 in #exponential

Download history 62/week @ 2023-10-29 29/week @ 2023-11-05 97/week @ 2023-11-12 107/week @ 2023-11-19 109/week @ 2023-11-26 105/week @ 2023-12-03 120/week @ 2023-12-10 125/week @ 2023-12-17 28/week @ 2023-12-24 13/week @ 2023-12-31 35/week @ 2024-01-07 157/week @ 2024-01-14 102/week @ 2024-01-21 41/week @ 2024-01-28 60/week @ 2024-02-04 95/week @ 2024-02-11

300 downloads per month
Used in retry-backoff

MIT/Apache

8KB
98 lines

Backoff   Build Status Latest Version

Backoff provides the base components for implementing backoff and retry operations.

Example

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));
    }
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Proteus by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~320KB