-
Notifications
You must be signed in to change notification settings - Fork 156
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 exponential backoff w/ decorrelated jitter. #59
base: master
Are you sure you want to change the base?
Add exponential backoff w/ decorrelated jitter. #59
Conversation
It's the fastest algorithm from the AWS Architecture Blog post ["Exponential Backoff and Jitter"](https://www.awsarchitectureblog.com/2015/03/backoff.html). Closes rholder#58.
Stop using self.assertRaises as a context manager.
@rholder added support for exponential backoff w/ decorrelated jitter. Please let me know what you think! |
@@ -197,6 +222,21 @@ def exponential_sleep(self, previous_attempt_number, delay_since_first_attempt_m | |||
result = 0 | |||
return result | |||
|
|||
def exponential_sleep_with_decorrelated_jitter(self, previous_attempt_number, delay_since_first_attempt_ms): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charlescbeebe would be good if instead of a commented block here it was a docstring enclosed in """
s.
Looks good to me. |
@rholder Whats going on with this? |
Ditto - would also like to see this merged; would make use of it today! |
It's the fastest algorithm from the AWS Architecture Blog post
"Exponential Backoff and Jitter".
Closes #58.