1 unstable release

0.1.0 Apr 19, 2024

#397 in WebAssembly

Download history 247/week @ 2024-04-17 122/week @ 2024-04-24 118/week @ 2024-05-01 159/week @ 2024-05-08 303/week @ 2024-05-15 373/week @ 2024-05-22 508/week @ 2024-05-29 561/week @ 2024-06-05 524/week @ 2024-06-12 678/week @ 2024-06-19 1318/week @ 2024-06-26

3,166 downloads per month
Used in 3 crates (via reconnecting-jsonrpsee-ws…)

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
~21K SLoC