Expand description
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);
}Structs§
- Retry
- Future that drives multiple attempts at an action via a retry strategy.
- RetryIf
- Future that drives multiple attempts at an action via a retry strategy. Retries are only attempted if
the
Errorreturned by the future satisfies a given condition. - Strategy
- Configurable retry strategy.
Traits§
- Action
- An action can be run multiple times and produces a future.
- Condition
- Specifies under which conditions a retry is attempted.