#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

#15 in #exponential-backoff

Download history 15/week @ 2024-07-29 40/week @ 2024-08-05 43/week @ 2024-08-12 16/week @ 2024-08-19 32/week @ 2024-08-26 54/week @ 2024-09-02 80/week @ 2024-09-09 41/week @ 2024-09-16 135/week @ 2024-09-23 26/week @ 2024-09-30 9/week @ 2024-10-07 148/week @ 2024-10-14 161/week @ 2024-10-21 87/week @ 2024-10-28 146/week @ 2024-11-04 72/week @ 2024-11-11

468 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