skillfed

aiobreaker

Python implementation of the Circuit Breaker pattern.

aiobreaker v1.2.0 409.0K downloads/30d#6,873 on PyPI29
Permissive license BSD Abandoned released

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 aiobreaker

uv

uv add aiobreaker

poetry

poetry add aiobreaker

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.6Topic :: Software Development :: Libraries

Tags

circuit breaker asyncioasync fault toleranceprevent cascading failuresasyncio resilience patternintegration point protectionasync error handling wrapper
circuit-breakerasyncioresilience

More Libraries packages