Open xpepermint opened 4 years ago
This could probably be implemented as a middleware, using https://crates.io/crates/backoff/
The correct solution here is a middleware, although that may presently be a bit challenging.
https://github.com/http-rs/surf/issues/192 proposes things related to this, namely potential middleware re-use and non-consumption of surf::Request
.
Edit: I do not believe this is currently possible, see https://github.com/http-rs/surf/issues/196
@Fishrock123 https://github.com/ihrwein/backoff/pull/13 has now merged, so this should be achievable using something similar to the code snippets in the comments of that PR.
It would be great to have a retry mechanic included.