Composable resilience and fault-tolerance middleware for Tower services.
tower-resilience provides a collection of resilience patterns that can be composed
together to build robust distributed systems. Each pattern is available as both an
individual crate and as a feature in this meta-crate.
Patterns
- Circuit Breaker (
circuitbreakerfeature): Prevents cascading failures by temporarily blocking calls to failing services - Bulkhead (
bulkheadfeature): Isolates resources by limiting concurrent calls - Time Limiter (
timelimiterfeature): Advanced timeout handling with event system - Cache (
cachefeature): Response memoization with LRU eviction and TTL - Retry (
retryfeature): Enhanced retry with flexible backoff strategies
Usage
Enable specific patterns via features:
[]
= { = "0.1", = ["circuitbreaker", "bulkhead"] }
Or enable all patterns:
[]
= { = "0.1", = ["full"] }
Example
#
#
Individual Crates
Each pattern is also available as a standalone crate for minimal dependencies:
tower-circuitbreakertower-bulkheadtower-timelimitertower-cachetower-retry-plustower-resilience-core(shared infrastructure)