trillium-client-retry 0.0.1

Automatic retry/backoff middleware for the trillium HTTP client
Documentation

trillium-client-retry

ci crates.io version docs.rs codecov

Automatic retry/backoff middleware for the trillium HTTP client. Drop RetryHandler onto a Client and failed requests — transport errors or retryable statuses (429, 503 by default) — are re-issued with configurable backoff, honoring a server-advertised Retry-After, bounded by a max-attempts count and a wall-clock budget. Idempotent methods only by default; request bodies are replayed when they can be cloned.

Example

use std::time::Duration;
use trillium_client::Client;
use trillium_client_retry::RetryHandler;
use trillium_testing::client_config;

let client = Client::new(client_config()).with_handler(
    RetryHandler::default()
        .with_exponential_backoff(Duration::from_millis(100))
        .with_max_attempts(5),
);

Safety

This crate uses #![forbid(unsafe_code)].

License