🧘♂️️Lightweight fault tolerance primitives for your resilient and modern Python microservices
Hyx (/ˈhʌɪx/) is a set of well-known stability patterns that are commonly needed when you build microservice-based applications. Hyx is meant to be Hystrix (Java), resilience4j (Java) or Polly (C#) but for the Python world.
Key Features
- Implements five commonly used resiliency patterns with various configurations based on advice and experience of industry leaders (e.g. AWS, Google, Netflix)
- Idiomatic Pythonic implementation based on decorators and context managers
- AsyncIO Native Implementation
- Lightweight. Readable Codebase. High Test Coverage
Requirements
- Python 3.9+
- AsyncIO-powered applications (no sync support?)
Installation
Hyx can be installed from PyPi:
pip install hyx
# or via poetry
poetry add hyx
Component Map
| Component | Problem | Solution | Implemented? |
|---|---|---|---|
| 🔁 Retry | The failures happen sometimes, but they self-recover after a short time | Automatically retry operation on temporary failures | ✅ |
| 💾 Cache | |||
| ⚡️ Circuit Breaker | When downstream microservices have got overloaded, sending even more load can make the situation only worse. | Stop doing requests to your failing microservice temporarily if amount of errors exceeded expected thresholds. Then see if the given time helped the microservice to recover | ✅ |
| ⏱ Timeout | Sometimes operations may take too much time. We cannot wait that long or after that time the success is unlikely | Bound waiting to a reasonable amount of time | ✅ |
| 🚰 Bulkhead | If executed without control, some code can take too much resources and put down the whole application (and upstream services) or cause slowness of other places of the application | Fix the amount of calls to the code, queue other calls and fail calls that goes beyond your capacity | ✅ |
| 🏃♂️ Rate Limiter | The microservice can be requested with any rate even one that can put it down if happens by accident | Limit the rate your system can be accessed by | ✅ |
| 🤝 Fallback | Nothing can guarantee you that your dependencies will work. What would you do when it's failing? | Degrade gracefully by defining some default values or placeholders if your dependencies are down | ✅ |
Inspired by Polly's Resiliency Policies
Acknowledgements
Metadata
Release files for hyx 0.0.2
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 |
|---|---|---|---|---|
| hyx-0.0.2.tar.gz | 20.4 kB | Without provenance | Details for hyx-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hyx-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for hyx-0.0.2-py3-none-any.whl |
Total release size: 48.1 kB
Release files / hyx-0.0.2.tar.gz
| Download URL | hyx-0.0.2.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f356299770e73b3fa8faf22d62e9cba5a1bb40b87b3ae77b97a425f6802c64e
|
|
BLAKE2b-256 checksum How to use checksums |
e4e6b08ae91bd0f8dd1caf76670308904b8577b538a87cf78ca764c5faf82459
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.9.7 Darwin/21.4.0
|
Release files / hyx-0.0.2-py3-none-any.whl
| Download URL | hyx-0.0.2-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a422f1c84c31575ac42affa3aa3ced43a23036fc1fab64941355d1cefbd1997
|
|
BLAKE2b-256 checksum How to use checksums |
e3600f1f8f1e308a193143872de11ec0519ea9cab1ee808dd48886d19b2d7359
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.9.7 Darwin/21.4.0
|
Security for hyx 0.0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.