finito 0.1.0

Retry behaviour for futures
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented0 out of 0 items with examples
  • Size
  • Source code size: 29.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.23 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • niklasad1/finito
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • niklasad1

finito

This library provides retry mechanisms to retry async operations.

It's based off tokio-retry with the difference that it isn't coupled to any specific async runtime and that it compiles for WASM.

Examples

use finito::{Retry, ExponentialBackoff};

async fn action() -> Result<u64, ()> {
    // do some real-world stuff here...
    Err(())
}

#[tokio::main]
async fn main() -> Result<(), ()> {
    let retry_strategy = ExponentialBackoff::from_millis(10).take(3);    // limit to 3 retries

    let result = Retry::new(retry_strategy, action).await?;

    Ok(())
}