Function futures_backoff::retry [] [src]

pub fn retry<A: Action>(action: A) -> Retry<A>

Run the given action, and retry on failure.

Uses the default retry strategy with exponential backoff and a maximum of 5 retry attempts.

To customize the retry strategy, take a look at Strategy.

Example

let future = retry(|| {
    // do some real-world stuff here...
    future::ok::<u32, ::std::io::Error>(42)
});