1 unstable release

0.1.0 Apr 19, 2024

#399 in WebAssembly

Download history 2118/week @ 2024-08-07 2189/week @ 2024-08-14 2631/week @ 2024-08-21 2100/week @ 2024-08-28 1716/week @ 2024-09-04 5754/week @ 2024-09-11 26905/week @ 2024-09-18 23974/week @ 2024-09-25 31627/week @ 2024-10-02 29392/week @ 2024-10-09 33435/week @ 2024-10-16 31378/week @ 2024-10-23 36668/week @ 2024-10-30 38297/week @ 2024-11-06 29043/week @ 2024-11-13 26499/week @ 2024-11-20

135,824 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