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
<div align="center">

<img src="https://devhub.vip/pages/docs/img/logo.png" alt="jitter-backoff logo" height="120">

# jitter-backoff

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

[![Crates.io Version](https://flat.badgen.net/crates/v/jitter-backoff)](https://crates.io/crates/jitter-backoff)
[![Docs.rs](https://img.shields.io/docsrs/jitter-backoff?style=flat-square)](https://docs.rs/jitter-backoff)
[![CI Status](https://img.shields.io/github/actions/workflow/status/crates-dev/ctares/rust.yml?branch=master&style=flat-square&label=CI)](https://github.com/crates-dev/ctares/actions/workflows/rust.yml)
[![Rust 2024](https://img.shields.io/badge/edition-2024-orange.svg?style=flat-square)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](../LICENSE)

[Workspace Overview](../README.md) ยท [API Docs](https://docs.rs/jitter-backoff/latest/)

</div>

---

## 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

```sh
cargo add jitter-backoff
```

## Usage

```rust
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

```sh
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](../LICENSE) file for details.

## Contact

For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).