Skip to content

v1.0.0

Compare
Choose a tag to compare
@Xuanwo Xuanwo released this 26 Aug 09:55
· 31 commits to main since this release
v1.0.0
ba6e069

Upgrade

Since 1.0.0, backon Retry doesn't take a reference of builder anymore:

+ your_fn.retry(ExponentialBuilder::default()).await;
- your_fn.retry(&ExponentialBuilder::default()).await;

Since version 0.5.0, backon no longer directly depends on tokio. Instead, users can now provide their own sleep implementation.

For example:

use anyhow::Result;
use backon::ExponentialBuilder;
use backon::Retryable;
use std::future::ready;

async fn main() -> Result<()> {
    let content = fetch
        .retry(&ExponentialBuilder::default())
        .sleep(tokio::time::sleep)
        .await?;
    Ok(())
}

To maintain the same behavior as before, please enable the tokio-sleep feature.

What's Changed

Full Changelog: v0.5.0...v1.0.0