djc/tokio-retry

Extensible, asynchronous retry behaviours for futures/tokio

Rust

144

115 commits

updated Aug 28, 2026

See the code

README

tokio-retry

Extensible, asynchronous retry behaviours for the ecosystem of tokio libraries.

Documentation Crates.io Build status

Features

  • Multiple retry strategies:
    • Exponential backoff
    • Fibonacci backoff
    • Fixed interval
  • no_std support
  • Optional support for random jitter (requires the rand feature)

Example

use tokio_retry::Retry;
use tokio_retry::strategy::{ExponentialBackoff, jitter};

async fn action() -> Result<u64, ()> {
    // do some real-world stuff here...
    Err(())
}

#[tokio::main]
async fn main() -> Result<(), ()> {
    let retry_strategy = ExponentialBackoff::from_millis(10)
        .map(jitter) // add jitter to delays
        .take(3);    // limit to 3 retries

    let result = Retry::start(retry_strategy, action).await?;

    Ok(())
}
retry
rust
tokio

djc/tokio-retry

Extensible, asynchronous retry behaviours for futures/tokio

Rust

144

115 commits

updated Aug 28, 2026

See the code

README

tokio-retry

Extensible, asynchronous retry behaviours for the ecosystem of tokio libraries.

Documentation Crates.io Build status

Features

  • Multiple retry strategies:
    • Exponential backoff
    • Fibonacci backoff
    • Fixed interval
  • no_std support
  • Optional support for random jitter (requires the rand feature)

Example

use tokio_retry::Retry;
use tokio_retry::strategy::{ExponentialBackoff, jitter};

async fn action() -> Result<u64, ()> {
    // do some real-world stuff here...
    Err(())
}

#[tokio::main]
async fn main() -> Result<(), ()> {
    let retry_strategy = ExponentialBackoff::from_millis(10)
        .map(jitter) // add jitter to delays
        .take(3);    // limit to 3 retries

    let result = Retry::start(retry_strategy, action).await?;

    Ok(())
}
retry
rust
tokio

Project health

crates.io

Latest release

0.3.2 · Jun 9, 2026

Releases this year

2

Significant stargazers

Neil Shen

195 followers · starred Mar 2017

Michal 'vorner' Vaner

288 followers · starred Mar 2017

Jimmy Cuadra

218 followers · starred Mar 2017

Paul Daniel Faria

26 followers · starred Aug 2017