Document using tokio::time::sleep (#111)

* Document using `tokio::time::sleep`

* Update reqwest-retry/src/middleware.rs

---------

Co-authored-by: Ethan Brierley <ethanboxx@gmail.com>
This commit is contained in:
Jan Srzednicki 2023-11-07 10:35:16 +01:00 committed by GitHub
parent 304d6f1ebc
commit b7017dca6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,9 @@ use task_local_extensions::Extensions;
/// and can be safely executed again.
///
/// Currently, it allows setting a [RetryPolicy] algorithm for calculating the __wait_time__
/// between each request retry.
/// between each request retry. Sleeping on non-`wasm32` archs is performed using
/// [`tokio::time::sleep`], therefore it will respect pauses/auto-advance if run under a
/// runtime that supports them.
///
///```rust
/// use reqwest_middleware::ClientBuilder;