1 unstable release
Uses old Rust 2015
0.1.0 | Mar 22, 2018 |
---|
#26 in #backoff
67 downloads per month
Used in 3 crates
(via spectacles-brokers)
25KB
545 lines
futures-backoff
Asynchronous retry strategies based on futures.
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