Add exponential backoff and jitter.

Hiya, I'm trying to migrate some code from old futures/old tokio and more specifically, tokio-retry, which helpfully provides a way to exponentially scale the backoff, and add jitter. I've made an attempt at reimplementing the same logic for this crate, taking a heavy inspiration from the original implementation.

I'm unsure if I should've taken a different approach to the ExponentialBackoff struct, and maybe have it implement ErrorHandler by wrapping another implementation of ErrorHandler, just like JitteredHandler is implemented.

Merge request reports

Loading