asyncbreaker
asyncbreaker is an asyncio-first Python implementation of the Circuit Breaker pattern from Michael T. Nygard's book Release It!.
Circuit breakers let one subsystem fail without taking down the whole application: you wrap risky calls (often I/O or integration boundaries) so that repeated failures trip the breaker, subsequent calls fail fast for a reset timeout, then a single trial call may close the circuit again.
Lineage
- pybreaker (Daniel Fernandes Martins) — original design.
- aiobreaker fork (Alexander Lyon) — asyncio instead of Tornado, packaging experiments.
- Current line — maintained by Sergey Turbinov; substantial rewrite toward a pure async API, async storage, and async listeners. Contact: @freems on Telegram.
Features
- Async
CircuitBreaker— useawait breaker.call(...) - Configurable failure threshold (
fail_max) and reset window (timeout_duration) - Excluded exceptions and predicate callables (business vs system errors)
- Multiple async
Listenerinstances - Pluggable async storage: in-process memory or Redis via
redis.asyncio - Optional
redisextra for Redis-backed storage
Requirements
Python 3.10+ (async patterns and typing used throughout).
Installation
pip install asyncbreaker
With Redis support (redis package):
pip install asyncbreaker[redis]
Usage
Create a breaker per integration point. Only async callables are supported; the decorator
rejects ordinary def functions.
from datetime import timedelta
from asyncbreaker import CircuitBreaker
api_breaker = CircuitBreaker(fail_max=5, timeout_duration=timedelta(seconds=60))
@api_breaker
async def fetch_remote():
...
# or explicitly:
await api_breaker.call(fetch_remote)
See changelog.md for the full API story (listeners, storage, open / close / half_open,
exclusion rules). A MkDocs site will be added later.
Development
This project uses uv:
uv sync
uv run pytest test
License
BSD 3-Clause; see license.md. This project bundles copyright from the pybreaker lineage;
additional copyright applies to the asyncio rewrite (see license.md).
Metadata
Release files for asyncbreaker 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asyncbreaker-2.1.1.tar.gz | 102.7 kB | With provenance | Details for asyncbreaker-2.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncbreaker-2.1.1-py3-none-any.whl | Python 3 | none | any | Details for asyncbreaker-2.1.1-py3-none-any.whl |
Total release size: 123.8 kB
Release files / asyncbreaker-2.1.1.tar.gz
| Download URL | asyncbreaker-2.1.1.tar.gz |
|---|---|
| Size | 102.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edac3a40166b5fb90d35b481e5f39197e05c3374a34435cc8948c8e49fc76fdb
|
|
BLAKE2b-256 checksum How to use checksums |
dd6e773a6e181682117b0a78992d99aadae75b5ddf20e4656b72d70cb786ff42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logRelease files / asyncbreaker-2.1.1-py3-none-any.whl
| Download URL | asyncbreaker-2.1.1-py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
606d1021b16f62beca9b51f71d0838c1341e7ee077bb4673dab5e2ef6ad311bc
|
|
BLAKE2b-256 checksum How to use checksums |
d76e503034ea4b855d4665204c3590f72d218b41ff5c0d5014f2049b2bbc9bf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logSecurity for asyncbreaker 2.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for asyncbreaker-2.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.