(WIP) Add @circuit_breaker decorator
Changes proposed in this pull request:
-
@circuit_breakerdecorator: decorating aConsumersubclass with this annotation adds a Circuit Breaker that monitors request(s) and improves the resilience of the client against cascading failures caused by downtime of the consumed service.
Codecov Report
Merging #156 into master will decrease coverage by
13.06%. The diff coverage is0%.
@@ Coverage Diff @@
## master #156 +/- ##
===========================================
- Coverage 100% 86.93% -13.07%
===========================================
Files 41 42 +1
Lines 2122 2441 +319
Branches 167 177 +10
===========================================
Hits 2122 2122
- Misses 0 319 +319
| Impacted Files | Coverage Δ | |
|---|---|---|
| uplink/circuit_breaker.py | 0% <0%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update b91a561...ac46aed. Read the comment docs.
Codecov Report
Merging #156 into master will decrease coverage by
12.92%. The diff coverage is0%.
@@ Coverage Diff @@
## master #156 +/- ##
===========================================
- Coverage 100% 87.07% -12.93%
===========================================
Files 41 42 +1
Lines 2175 2468 +293
Branches 173 182 +9
===========================================
- Hits 2175 2149 -26
- Misses 0 319 +319
| Impacted Files | Coverage Δ | |
|---|---|---|
| uplink/circuit_breaker.py | 0% <0%> (ø) |
|
| uplink/arguments.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/retry/retry.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/ratelimit.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/builder.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/retry/stop.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/commands.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/helpers.py | 100% <0%> (ø) |
:arrow_up: |
| uplink/converters/marshmallow_.py | 100% <0%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update fd007f5...c401aeb. Read the comment docs.
I can think of several instances, recently, where a circuit breaker would have been very helpful due to a misbehaving service that was giving itself the DDoS treatment. :p Very Cool!