Function futures_backoff::retry_if
[−]
[src]
pub fn retry_if<A: Action, C>(action: A, condition: C) -> RetryIf<A, C> where
C: Condition<A::Error>,
Run the given action, and retry on failure if the error satisfies a given condition.
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_if(|| { // do some real-world stuff here... future::ok(42) }, |err: &Error| err.kind() == ErrorKind::TimedOut);