1 unstable release

0.1.0 Apr 19, 2024

#239 in WebAssembly

Download history 2562/week @ 2024-08-26 1893/week @ 2024-09-02 1205/week @ 2024-09-09 20781/week @ 2024-09-16 26228/week @ 2024-09-23 28908/week @ 2024-09-30 29423/week @ 2024-10-07 30114/week @ 2024-10-14 35065/week @ 2024-10-21 27671/week @ 2024-10-28 44714/week @ 2024-11-04 30391/week @ 2024-11-11 26784/week @ 2024-11-18 29230/week @ 2024-11-25 23372/week @ 2024-12-02 31213/week @ 2024-12-09

111,803 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.3–1MB
~19K SLoC