#exponential-backoff #backoff #exponential

backoff-rs

Backoff provides the base components for implementing backoff and retry operations

1 unstable release

0.1.0 Aug 19, 2021

#12 in #exponential-backoff

Download history 150/week @ 2024-03-12 91/week @ 2024-03-19 164/week @ 2024-03-26 258/week @ 2024-04-02 142/week @ 2024-04-09 103/week @ 2024-04-16 169/week @ 2024-04-23 53/week @ 2024-04-30 64/week @ 2024-05-07 15/week @ 2024-05-14 3/week @ 2024-05-21 24/week @ 2024-05-28 58/week @ 2024-06-04 71/week @ 2024-06-11 15/week @ 2024-06-18 34/week @ 2024-06-25

181 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

~310KB