backoff-rs 0.1.0

Backoff provides the base components for implementing backoff and retry operations.
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented1 out of 9 items with examples
  • Size
  • Source code size: 23.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.65 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • rust-playground/backoff-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • deankarn

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