An exponential backoff iterator with collision avoidance.
Project description
Hello
Each iteration returns the total time (in seconds) to delay. It does this by increasing the maximum number of slots each iteration and then choosing a random number of slots between 0 and the maximum number of slots.
(See https://en.wikipedia.org/wiki/Exponential_backoff#Collision_avoidance)
Example:
import exponentional_backoff_ca
time_slot_secs = 2.0 # The number of seconds in each time slot.
num_iterations = 10 # The number of iterations.
exp_boff = ExponentialBackoff(time_slot_secs, num_iterations)
for interval in exp_boff:
print(f"number of seconds in this slot is {interval}")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for exponential_backoff_ca-2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 793a566ebcf6caf2186450e306bf53ecba8be06adb5206a5b690f29be5c8ba65 |
|
MD5 | 10279b345d83cf42ca5677213be80cf7 |
|
BLAKE2b-256 | 155499fdffb113d2832eedf1a89862045be49fbf468ae5b5a358424c12ef629f |