Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Retry and Ratelimit decorators #132

Merged
merged 32 commits into from
Dec 28, 2018
Merged

Add Retry and Ratelimit decorators #132

merged 32 commits into from
Dec 28, 2018

Conversation

prkumar
Copy link
Owner

@prkumar prkumar commented Dec 28, 2018

#102 #71

Changes proposed in this pull request:

  • Adds a ratelimit decorator to constrain consumers to making some maximum number of calls within a given time period.
  • Adds a retry decorator to enable reattempts of failed requests. The API for this decorator is heavily influenced by jd/tenacity.
  • Backend: Adds a request execution state machine that facilitates building logic like retrying, rate-limiting, and circuit breaking in an io-agnostic way. This means that the retry and ratelimit decorator should work for both blocking and non-blocking (e.g., Asyncio, Twisted) I/O!

Attention: @prkumar

@prkumar prkumar added this to the v0.8.0 milestone Dec 28, 2018
@codecov
Copy link

codecov bot commented Dec 28, 2018

Codecov Report

Merging #132 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #132    +/-   ##
======================================
  Coverage     100%   100%            
======================================
  Files          25     35    +10     
  Lines        1425   1853   +428     
  Branches      136    155    +19     
======================================
+ Hits         1425   1853   +428
Impacted Files Coverage Δ
uplink/retry.py 100% <100%> (ø)
uplink/clients/io/asyncio_strategy.py 100% <100%> (ø)
uplink/clients/io/__init__.py 100% <100%> (ø)
uplink/clients/io/transitions.py 100% <100%> (ø)
uplink/clients/io/templates.py 100% <100%> (ø)
uplink/clients/io/state.py 100% <100%> (ø)
uplink/clients/requests_.py 100% <100%> (ø) ⬆️
uplink/clients/io/blocking_strategy.py 100% <100%> (ø)
uplink/builder.py 100% <100%> (ø) ⬆️
uplink/clients/io/twisted_strategy.py 100% <100%> (ø)
... and 14 more

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 2eba20f...cef9de3. Read the comment docs.

@prkumar prkumar merged commit 5e28d37 into master Dec 28, 2018
This was referenced Dec 28, 2018
@prkumar prkumar deleted the io branch January 6, 2019 09:27
@prkumar prkumar mentioned this pull request Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant