BackON

Make retry like a built-in feature provided by Rust.
- Simple API: Native feel:
your_fn.retry(ExponentialBuilder::default()).await
. - Sync & Async: Supports both blocking and async operations seamlessly.
- Precise Control: Define when to retry and get notified via
when
andnotify
. - Custom Strategies: Use built-in backoff strategies (exponential, constant) or define custom ones. Also supports dynamic backoff, such as using the HTTP
Retry-After
header. - Cross-Platform: Works everywhere Rust does, including
wasm
&no-std
.
Quick Start
For more examples, check out the examples.
Retry an async function.
use Result;
use ExponentialBuilder;
use Retryable;
async
async
Retry a blocking function.
use Result;
use BlockingRetryable;
use ExponentialBuilder;
Contributing
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
Getting help
Submit issues for bug report or asking questions in discussion.
License
Licensed under Apache License, Version 2.0.