aiobreaker
Python implementation of the Circuit Breaker pattern.
What it is and what it does
aiobreaker is an asyncio-native implementation of the Circuit Breaker pattern, a design pattern that prevents cascading failures by wrapping calls to external services or integration points. When a service fails repeatedly, the circuit breaker stops sending requests to it temporarily, allowing the service time to recover while your application handles the failure gracefully instead of repeatedly hitting a broken endpoint.
The package lets you decorate async functions with a circuit breaker that tracks failures, opens when a threshold is reached, and automatically resets after a timeout. It supports configurable failure thresholds, excluded exceptions (for business logic errors that shouldn't trigger the breaker), event listeners for monitoring, and optional Redis-backed state sharing across processes. However, the project is no longer maintained—the last commit was in early 2022—so it may not work correctly with recent Python or asyncio changes.
Use it for:
- Protect database queries from overwhelming a struggling database by stopping requests when failures spike
- Guard API calls to third-party services so your app fails fast instead of timing out repeatedly
- Implement resilience in microservices by preventing one failing service from dragging down dependent services
- Monitor integration point health with event listeners to alert on repeated failures or circuit state changes
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements the Circuit Breaker pattern for asyncio applications, allowing you to wrap dangerous operations (like external API calls or database queries) so they fail gracefully without cascading failures across your system.
Yes, if you need Circuit Breaker pattern support in an asyncio application and can accept that the package is unmaintained. The code is simple, has no dependencies, and the pattern itself is stable—but be aware that it will not receive updates for Python version changes or asyncio improvements. Consider it only for stable, long-lived codebases where you can maintain a fork if needed.
Install
aiobreaker on PyPI
pip
pip install aiobreakeruv
uv add aiobreakerpoetry
poetry add aiobreakerInstalling aiobreaker
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2021-05-17 and last commit 2022-01-01—so it will not receive bug fixes or security updates for new Python or asyncio changes.
License in practice
BSD permissive license means you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install aiobreaker
from aiobreaker import CircuitBreaker
from datetime import timedelta
db_breaker = CircuitBreaker(fail_max=5, reset_timeout=timedelta(seconds=60))
@db_breaker
async def outside_integration():
# Your async operation here
pass
Requires Python 3.6 or higher; designed for asyncio-based applications only.
Verify before relying
- Whether the package works reliably with Python versions released after 2022-01-01
- Current compatibility with modern asyncio implementations and async/await patterns
- Whether optional Redis backing feature is functional and documented
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,915 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 408,955/month — #6,873 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiobreaker-1.2.0-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
circuitbreakerA Python decorator that implements the Circuit…
permissive · top 5,000 on PyPI
pybreakerPyBreaker wraps function calls with a circuit…
permissive · top 1,000 on PyPI
purgatoryPurgatory implements the circuit breaker…
permissive · top 15,000 on PyPI
waiterWaiter provides iteration-based retry and…
permissive · top 15,000 on PyPI
async-stripeProvides an asynchronous wrapper around the…
permissive · top 15,000 on PyPI
threadloopRuns Tornado coroutines from synchronous Python…
permissive · top 15,000 on PyPI
janusProvides a thread-safe queue with both…
permissive · top 5,000 on PyPI
torchft-nightlyProvides per-step fault tolerance for PyTorch…
unclear · top 15,000 on PyPI
retry2Provides a decorator and function wrapper to…
permissive · top 5,000 on PyPI
mistralai-workflowsMistral Workflows is a Python SDK for building…
permissive · top 15,000 on PyPI