uplink icon indicating copy to clipboard operation
uplink copied to clipboard

(WIP) Add @circuit_breaker decorator

Open prkumar opened this issue 6 years ago • 3 comments

Changes proposed in this pull request:

  • @circuit_breaker decorator: decorating a Consumer subclass 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.

prkumar avatar Apr 03 '19 04:04 prkumar

Codecov Report

Merging #156 into master will decrease coverage by 13.06%. The diff coverage is 0%.

Impacted file tree graph

@@             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 data Powered by Codecov. Last update b91a561...ac46aed. Read the comment docs.

codecov[bot] avatar Apr 03 '19 04:04 codecov[bot]

Codecov Report

Merging #156 into master will decrease coverage by 12.92%. The diff coverage is 0%.

Impacted file tree graph

@@             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 data Powered by Codecov. Last update fd007f5...c401aeb. Read the comment docs.

codecov[bot] avatar Apr 03 '19 04:04 codecov[bot]

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!

cognifloyd avatar Jun 16 '19 03:06 cognifloyd