jitter-backoff 11.2.0

Zero-dependency exponential backoff, full/equal/decorrelated jitter, deadline retry budgets, Retry-After header parsing, and synchronous retry execution.
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented0 out of 0 items with examples
  • Size
  • Source code size: 31.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 330.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates-dev/ctares
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vshengbro

jitter-backoff

Zero-Dependency Exponential Backoff, Jitter Strategies, Atomic Retry Budgets & Retry-After Parsing

Crates.io Version Docs.rs CI Status Rust 2024 License: MIT

Workspace Overview · API Docs


Overview

jitter-backoff implements zero-dependency exponential backoff with full, equal, and decorrelated jitter, a lock-free atomic RetryBudget against retry storms, and RFC 9110 Retry-After parsing for HTTP clients and workers.

Installation

cargo add jitter-backoff

Usage

use jitter_backoff::{JitterMode, RetryBudget, RetryPolicy, parse_retry_after};

let policy = RetryPolicy::new(5, 100, 30_000).with_jitter(JitterMode::Full);
let mut state = policy.start_with_seed(42);
let _delay = state.next_delay();

let budget = RetryBudget::new(20, 100);
budget.deposit();
assert!(budget.try_withdraw());
assert!(parse_retry_after("120").is_some());

Verification

cargo run -p crate-cli -- fmt --check
cargo clippy -p jitter-backoff --all-features --all-targets -- -D warnings
cargo test -p jitter-backoff --all-features

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For inquiries, please contact the author at root@devhub.vip.