Bulkhead pattern implementation with Trio for structured concurrency and resilient circuit breaking
Project description
Bulkman
Enterprise-Grade Bulkhead Pattern for Python
Bulkman is a robust, production-ready implementation of the Bulkhead pattern, designed to isolate resources and prevent cascading failures in mission-critical distributed systems. It supports both modern async (Trio) and traditional synchronous (Threading) workloads with zero overhead.
Key Capabilities
- Resource Isolation: Limits concurrent access to prevent service exhaustion.
- Circuit Breaker Integration: Built-in distributed circuit breaking via
resilient-circuit. - Dual Mode:
- Async: Native Trio support for high-concurrency IO.
- Sync: Zero-overhead
ThreadPoolExecutorimplementation for CPU-bound or blocking IO tasks.
- Observability: Full
contextvarssupport for distributed tracing (OpenTelemetry/Datadog). - Type Safe: 100% type-hinted and rigorously tested (>92% coverage).
Documentation
- User Guide: Installation, Quick Start (Async), and Configuration.
- Synchronous / Threading Guide: Best practices for blocking workloads (Flask, Django, Scripts).
- Contributing: Setup, testing, and contribution guidelines.
Quick Install
pip install bulkman
Quick Example (Blocking/Threading)
For legacy or synchronous applications, use BulkheadThreading:
from bulkman import BulkheadThreading, BulkheadConfig
# Configure
config = BulkheadConfig(name="db_writer", max_concurrent_calls=10, timeout_seconds=5.0)
bulkhead = BulkheadThreading(config)
# Execute
try:
future = bulkhead.execute(my_blocking_function, data)
result = future.result(timeout=5.0)
print(result.result)
except TimeoutError:
print("System overloaded")
👉 See the User Guide for Async/Trio examples
License
Licensed under the Apache License 2.0.
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 bulkman-1.2.1.tar.gz.
File metadata
- Download URL: bulkman-1.2.1.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1848f0b3dc4fa5f4fd621026c102c08acb9420fecdb4769d305c5a12351c26a
|
|
| MD5 |
73f69cc18c9b6e00c1c3dddeb00f7eef
|
|
| BLAKE2b-256 |
22bd9b5fe4e47d7185675a51c8f25e1daf08e4a5835e0293e629530f85fc450d
|
File details
Details for the file bulkman-1.2.1-py3-none-any.whl.
File metadata
- Download URL: bulkman-1.2.1-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b676c68c2e145c8295309bd28b5084ad6bb5ace1de3beff9d391120fa2fb68b8
|
|
| MD5 |
23604c7c85b3bcf9623f5e31e890d93b
|
|
| BLAKE2b-256 |
b94890f8c878936e396aa002484c9f90b71a7b538a5681c51c51b92bbd219b1e
|