Skip to content

v0.5.0

Compare
Choose a tag to compare
@Xuanwo Xuanwo released this 22 Aug 11:07
· 40 commits to main since this release
v0.5.0
d292fae

Upgrade

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

  • Remove duplicate example, point to examples on docs index page by @matildasmeds in #84
  • ci: Use macos-latest for test by @Xuanwo in #87
  • feat: Remove dependences on pin_project and futures_core by @Xuanwo in #86
  • docs: Add an example for sqlx by @Xuanwo in #91
  • Use wasm-compatible sleep if compiled for wasm32 by @wackazong in #92
  • feat: Allow user to provide sleeper by @Xuanwo in #93
  • Bump to version 0.5.0 by @Xuanwo in #94

New Contributors

Full Changelog: v0.4.4...v0.5.0