Elixir macros for linear retry, exponential backoff, and wait patterns with composable delay streams.
ElixirRetry is an Elixir library that provides macros for implementing retry and wait logic with configurable backoff strategies. It solves the problem of transient failures in distributed systems by allowing developers to easily add resilient retry patterns to their code, using composable delay streams for linear, exponential, or constant backoff.
Elixir developers building distributed systems, APIs, or services that need to handle intermittent failures gracefully, such as external API calls, database operations, or network requests.
Developers choose ElixirRetry for its simplicity, composability, and seamless integration with Elixir's streaming model, offering a declarative way to add robust retry logic without boilerplate code.
Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides helper functions like constant_backoff, linear_backoff, and exponential_backoff that integrate with Elixir's Stream API, enabling flexible custom retry behaviors as shown in the README examples.
Allows precise control over retry triggers using atoms, functions, or lists via the atoms and rescue_only options, supporting complex failure handling scenarios detailed in the documentation.
The @retry annotation lets developers add retry logic to functions without cluttering implementation code, offering a clean, declarative approach as demonstrated in the annotation example.
Includes a separate wait macro for polling until conditions become truthy, which is explicitly highlighted as useful for asynchronous tests and system coordination in the README.
Requires familiarity with Elixir's Stream abstractions to compose custom delay behaviors, which can be a steep learning curve for developers not versed in functional streaming concepts.
Lacks built-in circuit breaker patterns, a common feature in resilient systems to prevent cascading failures, forcing developers to integrate additional libraries or custom code.
Improper setup of delay streams or retry conditions—like missing Stream.take() or expiry()—can lead to infinite retries or resource exhaustion, relying on developer diligence for safety.