#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

#26 in #backoff

Download history 22/week @ 2024-07-21 22/week @ 2024-07-28 19/week @ 2024-08-04 21/week @ 2024-08-11 10/week @ 2024-08-18 38/week @ 2024-08-25 51/week @ 2024-09-01 14/week @ 2024-09-08 11/week @ 2024-09-15 37/week @ 2024-09-22 20/week @ 2024-09-29 2/week @ 2024-10-06 17/week @ 2024-10-13 9/week @ 2024-10-20 16/week @ 2024-10-27 25/week @ 2024-11-03

67 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

~435–620KB