1 unstable release

0.1.0 Apr 19, 2024

#405 in WebAssembly

Download history 990/week @ 2024-07-21 1039/week @ 2024-07-28 1816/week @ 2024-08-04 2043/week @ 2024-08-11 2376/week @ 2024-08-18 2665/week @ 2024-08-25 1905/week @ 2024-09-01 1228/week @ 2024-09-08 19419/week @ 2024-09-15 27039/week @ 2024-09-22 28334/week @ 2024-09-29 29810/week @ 2024-10-06 29602/week @ 2024-10-13 35773/week @ 2024-10-20 27959/week @ 2024-10-27 42805/week @ 2024-11-03

137,222 downloads per month
Used in 8 crates (2 directly)

MIT license

18KB
397 lines

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(())
}

lib.rs:

finito 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.

Dependencies

~0.4–1MB
~20K SLoC