#future #retry #backoff #io-error

futures-backoff

Asynchronous retry strategies for futures

1 unstable release

Uses old Rust 2015

0.1.0 Mar 22, 2018

#29 in #backoff

Download history 2/week @ 2024-11-13 11/week @ 2024-11-20 12/week @ 2024-11-27 19/week @ 2024-12-04 39/week @ 2024-12-11 12/week @ 2024-12-18 3/week @ 2025-01-01 14/week @ 2025-01-08 30/week @ 2025-01-15 17/week @ 2025-01-22 17/week @ 2025-01-29 37/week @ 2025-02-05 33/week @ 2025-02-12 14/week @ 2025-02-19 31/week @ 2025-02-26

118 downloads per month
Used in 3 crates (via spectacles-brokers)

MIT license

25KB
545 lines

futures-backoff

Asynchronous retry strategies based on futures.

Build Status dependency status

Documentation

Installation

Add this to your Cargo.toml:

[dependencies]
futures-backoff = "0.1"

Examples

extern crate futures;
extern crate futures_backoff;

use futures::{Future, future};
use futures_backoff::retry;

fn main() {
    let future = retry(|| {
        // do some real-world stuff here...
        future::ok::<u32, ::std::io::Error>(42)
    });

    let result = future.wait();

    assert_eq!(result, Ok(42));
}

lib.rs:

This library provides asynchronous retry strategies for use with the popular futures crate.

Installation

Add this to your Cargo.toml:

[dependencies]
futures-backoff = "0.1"

Examples

extern crate futures;
extern crate futures_backoff;

use futures::{Future, future};
use futures_backoff::retry;

fn main() {
    let future = retry(|| {
        // do some real-world stuff here...
        future::ok::<u32, ::std::io::Error>(42)
    });

    let result = future.wait();

    assert_eq!(result.unwrap(), 42);
}

Dependencies

~445–630KB