baldur
An open source library that adds circuit breakers and fallback responses to external calls in Python services.
What does it do?
Attach decorators to calls to dependent services to apply a circuit breaker and fallback response during failures. Initially, it runs in process memory without Redis or Docker and includes adapters for Django, FastAPI, Flask, and Celery. Failed jobs can be stored under specified conditions and rerun after recovery, but the source cautions that retries can duplicate payment or model calls and says to configure reruns only for safe operations.
Key features
- Apply circuit breakers and fallback responses with decorators.
- Configure retries for calls that need them.
- Store failed jobs and rerun them under specified conditions.
- Provide Django, FastAPI, Flask, and Celery adapters.
- Run the default configuration in memory without Redis or Docker.