Skip to main content

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

exponential_backoff_ca-2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exponential_backoff_ca-2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file exponential_backoff_ca-2.tar.gz.

File metadata

  • Download URL: exponential_backoff_ca-2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for exponential_backoff_ca-2.tar.gz
Algorithm Hash digest
SHA256 e0d20b862b305b790b0baa9361b7f4d777fd1c7ba2eb106f495670abe616f612
MD5 8113c8fdcaa0453f35cfa539207da569
BLAKE2b-256 ca5eea7bdb45b029528bf89605fa444263aab9a0725b6d14bd2601767b71f3ca

See more details on using hashes here.

File details

Details for the file exponential_backoff_ca-2-py3-none-any.whl.

File metadata

File hashes

Hashes for exponential_backoff_ca-2-py3-none-any.whl
Algorithm Hash digest
SHA256 793a566ebcf6caf2186450e306bf53ecba8be06adb5206a5b690f29be5c8ba65
MD5 10279b345d83cf42ca5677213be80cf7
BLAKE2b-256 155499fdffb113d2832eedf1a89862045be49fbf468ae5b5a358424c12ef629f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page