#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

#20 in #backoff

Download history 149/week @ 2023-11-27 141/week @ 2023-12-04 172/week @ 2023-12-11 123/week @ 2023-12-18 13/week @ 2023-12-25 107/week @ 2024-01-08 160/week @ 2024-01-15 325/week @ 2024-01-22 267/week @ 2024-01-29 319/week @ 2024-02-05 262/week @ 2024-02-12 265/week @ 2024-02-19 148/week @ 2024-02-26 103/week @ 2024-03-04 50/week @ 2024-03-11

572 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

~420–610KB