ihrwein / backoff

Exponential backoff and retry for Rust.
https://github.com/ihrwein/backoff
Apache License 2.0
306 stars 37 forks source link

Does someone want to fork this? #66

Open FrankReh opened 1 year ago

FrankReh commented 1 year ago

This repo hasn't had input from its author in 17 months. No commits, no issues answered, no PRs addressed. (Not complaining, just an observation.)

Has someone already forked and tried to address the issues and PRs that have come up or is there another crate that has been serving the same purpose?

Does someone know the protocol for the Rust docs.rs site when it comes to crates that may no longer be supported?

Xuanwo commented 2 months ago

Hi, I have implemented https://github.com/Xuanwo/backon.

use anyhow::Result;
use backon::ExponentialBuilder;
use backon::Retryable;

async fn fetch() -> Result<String> {
    Ok(reqwest::get("https://www.rust-lang.org/").await?.text().await?)
}

#[tokio::main]
async fn main() -> Result<()> {
    let content = fetch.retry(&ExponentialBuilder::default()).await?;
    println!("Fetch succeeded: {}", content);

    Ok(())
}

Feel free to give it a try!