4 releases (2 breaking)

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

#1003 in Asynchronous

Download history 30/week @ 2024-07-25 13/week @ 2024-08-01 10/week @ 2024-08-08 10/week @ 2024-08-15 7/week @ 2024-08-22 2/week @ 2024-08-29 85/week @ 2024-09-12 338/week @ 2024-09-19 208/week @ 2024-09-26 57/week @ 2024-10-03 86/week @ 2024-10-10 109/week @ 2024-10-17 74/week @ 2024-10-24 59/week @ 2024-10-31 89/week @ 2024-11-07

377 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