#retry #async

named-retry

A simple utility for retrying fallible asynchronous operations

5 releases (3 breaking)

Uses new Rust 2024

0.4.0 Feb 26, 2025
0.3.0 Nov 14, 2024
0.2.1 Mar 17, 2023
0.2.0 Aug 18, 2022
0.1.0 Jul 26, 2022

#371 in Debugging

Download history 1320/week @ 2025-10-02 1265/week @ 2025-10-09 926/week @ 2025-10-16 2140/week @ 2025-10-23 1048/week @ 2025-10-30 976/week @ 2025-11-06 932/week @ 2025-11-13 10787/week @ 2025-11-20 17710/week @ 2025-11-27 20897/week @ 2025-12-04 28396/week @ 2025-12-11 24213/week @ 2025-12-18 13349/week @ 2025-12-25 19413/week @ 2026-01-01 13221/week @ 2026-01-08 573/week @ 2026-01-15

48,524 downloads per month
Used in blobnet

MIT license

9KB
149 lines

Utilities for retrying falliable, asynchronous operations.


named-retry

This is a simple, impl Copy utility for retrying fallible asynchronous operations, with helpful log messages through tracing.

use std::time::Duration;
use named_retry::Retry;

let retry = Retry::new("test")
    .attempts(5)
    .base_delay(Duration::from_secs(1))
    .delay_factor(2.0)
    .jitter(true);

let result = retry.run(async || { Ok::<_, ()>("done!") }).await;
assert_eq!(result, Ok("done!"));

Dependencies

~6.5–9.5MB
~83K SLoC