Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 987 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 987 Bytes

futures-backoff

Asynchronous retry strategies based on futures.

Build Status crates 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));
}