Unified resilience patterns — retry, circuit breaker, rate limiter, timeout, bulkhead, fallback.
Project description
crashbytes-resilience
Unified resilience patterns for Python — retry, circuit breaker, rate limiter, timeout, bulkhead, fallback. Zero dependencies. Sync + async. Thread-safe.
Install
pip install crashbytes-resilience
Usage
from crashbytes_resilience import retry, circuit_breaker, timeout, fallback, pipeline
@retry(max_attempts=3, delay=0.5, backoff=2.0)
def fetch_data():
...
@circuit_breaker(failure_threshold=5, recovery_timeout=30)
def call_service():
...
@timeout(5.0)
async def slow_operation():
...
@fallback(lambda: {"cached": True})
def get_config():
...
# Compose patterns
@pipeline(retry(max_attempts=3, delay=0.1), timeout(5.0), fallback(lambda: None))
def resilient_call():
...
Patterns
| Decorator | Description |
|---|---|
@retry() |
Retry with exponential backoff |
@circuit_breaker() |
Stop calling failing services |
@rate_limiter() |
Token-bucket rate limiting |
@timeout() |
Time-limit operations |
@bulkhead() |
Limit concurrent executions |
@fallback() |
Provide fallback on failure |
@pipeline() |
Compose multiple patterns |
All patterns work with both sync and async functions.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crashbytes_resilience-1.1.0.tar.gz.
File metadata
- Download URL: crashbytes_resilience-1.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc3ca96f54b500732fff3a3281ef6a4b33e692d65eb9f606bc2460666922781c
|
|
| MD5 |
0311fb8216a28eda419f4b6e969e7c25
|
|
| BLAKE2b-256 |
a3003d7a376fe309d40c7c02ff42ebc92b3d2ec7e7dcabb176dc4ddee1efea94
|
Provenance
The following attestation bundles were made for crashbytes_resilience-1.1.0.tar.gz:
Publisher:
publish.yml on CrashBytes/crashbytes-resilience
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crashbytes_resilience-1.1.0.tar.gz -
Subject digest:
cc3ca96f54b500732fff3a3281ef6a4b33e692d65eb9f606bc2460666922781c - Sigstore transparency entry: 1435299008
- Sigstore integration time:
-
Permalink:
CrashBytes/crashbytes-resilience@e313cfdc2ada28097e032c003992325058dc13d8 -
Branch / Tag:
refs/tags/1.1.0 - Owner: https://github.com/CrashBytes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e313cfdc2ada28097e032c003992325058dc13d8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file crashbytes_resilience-1.1.0-py3-none-any.whl.
File metadata
- Download URL: crashbytes_resilience-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f3190fdb759b2119f112f3b960b2fc4b892fa892060e98628ea3545fbeb9b8a
|
|
| MD5 |
e45a02cc27ab272762ff552481cc5377
|
|
| BLAKE2b-256 |
d0d05bb683b80a0226363c23dfbb615d9bfc968191a4a5954e3f67194c1c9ba2
|
Provenance
The following attestation bundles were made for crashbytes_resilience-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on CrashBytes/crashbytes-resilience
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crashbytes_resilience-1.1.0-py3-none-any.whl -
Subject digest:
1f3190fdb759b2119f112f3b960b2fc4b892fa892060e98628ea3545fbeb9b8a - Sigstore transparency entry: 1435299015
- Sigstore integration time:
-
Permalink:
CrashBytes/crashbytes-resilience@e313cfdc2ada28097e032c003992325058dc13d8 -
Branch / Tag:
refs/tags/1.1.0 - Owner: https://github.com/CrashBytes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e313cfdc2ada28097e032c003992325058dc13d8 -
Trigger Event:
push
-
Statement type: