Skip to content

Simple retries for fallible asynchronous operations

Notifications You must be signed in to change notification settings

modal-labs/named-retry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple retries for fallible asynchronous operations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages