#retry #backoff #fault-tolerance #resilience #rust

resilient-rs

A Rust utility library for fault tolerance, including retry strategies, backoff mechanisms, and failure handling

12 unstable releases (3 breaking)

Uses new Rust 2024

new 0.4.6 Mar 15, 2025
0.4.5 Mar 14, 2025
0.3.0 Mar 1, 2025
0.2.1 Mar 1, 2025
0.1.1 Feb 28, 2025

#214 in Asynchronous

Download history 729/week @ 2025-02-28 254/week @ 2025-03-07

983 downloads per month

MIT license

47KB
736 lines

Resilient-rs

A Rust utility library for fault tolerance, including retry strategies, backoff mechanisms, failure handling and much more.

Join Community Badge GitHub contributors Crates.io Downloads Docs.rs

💖 Loved the work? Subscribe to my YouTube channel or consider giving this repository a ⭐ to show your support!


🚀 Feature Overview

Here’s a snapshot of what this library brings to the table—resilience, reliability, and a sprinkle of magic! Check out the features, their details, and where they stand:

Feature Details Status
🔄 Retry Basic retry functionality—keeps trying! Stable
With Backoff (exponential)—smart delays Stable
With Fallback—graceful recovery Stable
⚡ Execute Run ops with timeout & fallback—like a pro Stable
🛡️ Circuit Breaker Stops cascading chaos in its tracks 🛠️ Planned
📦 Memoize Cache it up for the future 🛠️ Planned
📜 Logging Debug like a detective—full support Stable
📚 More Examples Extra demos to spark your imagination 🛠️ Planned

Notes:

  • Supported Contexts: All features work seamlessly for both synchronous and asynchronous operations—flexibility is our middle name!

🏃‍♂️ Runtime Compatibility

This library plays nice with your favorite Rust async runtimes. The resilient_rs::asynchronous module has you covered with:

  • Tokio - Power up with Tokio’s async I/O and runtime
  • async-std - Keep it light with async-std’s sleek runtime
  • futures - Stick to the basics with the core futures crate and blocking execution

📦 How to Use resilient-rs

Here’s a quick example of how to use the resilient-rs crate in your Rust project.

1️⃣ Add resilient-rs to Your Cargo.toml

Add the following line to your Cargo.toml file:

[dependencies]
resilient-rs = "0.4.5" # Replace with the latest version

OR

cargo add resilient-rs

📖 Examples

Hover over the function you want to use in your IDE to see code documentation examples, or check out the code-examples folder for example usage of this crate.

🚀 Contributing

We welcome your contributions! Please check out our Contributing Guidelines to get started.

Dependencies

~5–14MB
~186K SLoC