Registry / async / tokio-retry

tokio-retry

JSON →
library0.3.1rscratesunverified

Extensible, asynchronous retry behaviours for futures/tokio.

# Cargo.toml [dependencies] tokio-retry = "0.3.1"
INSTALL
IMPORT
SIG · TOKIO-RETRY
T
tokio-retry
asyncrustv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Retry
use tokio_retry::Retry;

Retry an async operation with exponential backoff.

use tokio_retry::Retry; use tokio_retry::strategy::ExponentialBackoff; #[tokio::main] async fn main() { let retry_strategy = ExponentialBackoff::from_millis(10).take(3); let result = Retry::spawn(retry_strategy, || async { // Some fallible async operation Ok::<_, std::io::Error>(42) }).await; println!("Result: {:?}", result); }
Debug
Known issues
gotchaRequires a Tokio runtime to be active.
fix
Wrap the call in `#[tokio::main]` or manually create a runtime.
affects: >=0.1.0
Upgrade
Version history
0.3.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
37 hits · last 30 days
node
32
Resources
tokio-retry — cargo add tokio-retry · libregistry