5 releases (3 breaking)

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

#289 in Asynchronous

Download history 356/week @ 2024-11-15 97/week @ 2024-11-22 252/week @ 2024-11-29 165/week @ 2024-12-06 421/week @ 2024-12-13 93/week @ 2024-12-20 235/week @ 2024-12-27 255/week @ 2025-01-03 371/week @ 2025-01-10 195/week @ 2025-01-17 288/week @ 2025-01-24 341/week @ 2025-01-31 447/week @ 2025-02-07 885/week @ 2025-02-14 1046/week @ 2025-02-21 416/week @ 2025-02-28

2,831 downloads per month
Used in blobnet

MIT license

9KB
149 lines

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!"));

lib.rs:

Utilities for retrying falliable, asynchronous operations.

Dependencies

~2.3–8MB
~52K SLoC