4 releases (2 breaking)

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

#369 in Asynchronous

Download history 77/week @ 2024-10-26 76/week @ 2024-11-02 369/week @ 2024-11-09 179/week @ 2024-11-16 101/week @ 2024-11-23 233/week @ 2024-11-30 175/week @ 2024-12-07 408/week @ 2024-12-14 100/week @ 2024-12-21 227/week @ 2024-12-28 281/week @ 2025-01-04 367/week @ 2025-01-11 189/week @ 2025-01-18 336/week @ 2025-01-25 310/week @ 2025-02-01 711/week @ 2025-02-08

1,581 downloads per month
Used in blobnet

MIT license

9KB
154 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