What problem does it solve?
This Skill provides Python code patterns to make applications resilient to failures in external services, preventing cascading errors and ensuring graceful operation even when dependencies are unavailable.
Core Features & Use Cases
- Retry with Backoff: Automatically retry failed operations with increasing delays to avoid overwhelming services.
- Circuit Breaker: Prevent repeated calls to a failing service, failing fast instead of waiting for timeouts.
- Timeout Wrapper: Enforce maximum execution times for operations to prevent indefinite hangs.
- Graceful Degradation: Allow applications to continue functioning with reduced capabilities when non-critical services fail.
- Use Case: When calling a third-party API that is occasionally slow or unavailable, these patterns ensure your application doesn't crash, retries intelligently, and can even provide a degraded experience if the API is down for an extended period.
Quick Start
Use the resilience-patterns skill to implement retry logic with exponential backoff for a function that calls an external API.