fure
A crate for retrying futures.
[Policy] trait will help you define different retry policies.
Some builtin policies can be found in [policies] module.
Examples.
Interval retry.
Starts with sending a request, setting up a 1 second timer, and waits for either of them.
If the timer completes first (it means that the request didn't complete in 1 second) one more request fires.
If the request completes first and it has an [Ok] response it is returned, if request has an [Err] response, timer resets and a new request fires.
At most 4 requests will be fired.
When one of runninng requests completes with an [Ok] result it will be returned.
use ;
use Duration;
let get_body = ;
let policy = retry_failed;
let body = retry.await?;
println!;
Sequential retry with backoff.
Retries failed requests with an exponential backoff and a jitter.
use ;
use Duration;
let get_body = ;
let exp_backoff = exponential
.map;
let policy = retry_if;
let body = retry.await?;
println!;
License: MIT