{ "info": { "author": "Nathan Reynolds", "author_email": "email@nreynolds.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Topic :: Software Development" ], "description": "ExpBackoff\n==========\n\nAn exponential backoff implementation as described in an `AWS architecture post`_. Uses full jitter.\n\nExample\n-------\n\n.. code:: python\n\n from expbackoff import Backoff\n\n backoff = Backoff(base_seconds=0.5, max_seconds=120)\n\n while True:\n backoff.sleep() # Depending on previous failures, potentially delay before performing an action\n success = do_a_thing() # Perform an action, record whether it succeeded\n backoff.update(success) # Update the failure count\n\nAPI\n---\n\n- ``backoff = expbackoff.Backoff(...)``\n- Create a Backoff object. Arguments:\n\n - ``base_seconds`` (required): Part of the backoff calculation, i.e\n ``base_seconds * 2 ^ (failures - 1)``\n - ``max_seconds`` (required): Max seconds to delay, regardless of\n failure count.\n - ``failures`` (optional): Number of current failures. Useful if\n another service is handling your retries. Defaults to ``0``.\n - ``random`` (optional): A ``random`` object. Defaults to\n ``random.random``.\n\n- ``backoff.sleep()``: If failures have occurred, sleep for\n ``backoff.get_seconds_with_jitter()``\n- ``backoff.update(success)``: Update the failure count by passing a\n boolean representing success.\n- ``backoff.get_seconds_with_jitter()``: The current backoff time in seconds, with jitter\n applied. Zero if there are no recorded failures. Read-only.\n- ``backoff.get_raw_seconds()``: The current backoff time in seconds, *without* jitter\n applied. Zero if there are no recorded failures. Read-only.\n- ``backoff.failures``: The current number of failures. Read-only.\n\nAlternatives\n------------\n\nPopular options are `retrying`_ and `backoff`_. These both use a\ndecorator API so aren\u2019t suitable for all uses - hence ``expbackoff``.\n\n.. _AWS architecture post: https://www.awsarchitectureblog.com/2015/03/backoff.html\n.. _retrying: https://pypi.python.org/pypi/retrying\n.. _backoff: https://pypi.python.org/pypi/backoff/1.3.1", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nathforge/expbackoff", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "expbackoff", "package_url": "https://pypi.org/project/expbackoff/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/expbackoff/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/nathforge/expbackoff" }, "release_url": "https://pypi.org/project/expbackoff/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Exponential backoff with jitter.", "version": "0.1.1" }, "last_serial": 2528148, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "57c94e0690497c9bf360f8379c1ba345", "sha256": "cb33b891707a1e9853ceacfb4d5f389afc4656bb03c2b23534789ca8dab75d37" }, "downloads": -1, "filename": "expbackoff-0.1.0.tar.gz", "has_sig": false, "md5_digest": "57c94e0690497c9bf360f8379c1ba345", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2525, "upload_time": "2016-12-15T13:30:55", "url": "https://files.pythonhosted.org/packages/67/1a/5826da2cb0fdde290244dbdf7b87249a549c9350be610c77400425e8c2ca/expbackoff-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b8bed1808e382eb9fa8bd6da2ba3f2d6", "sha256": "b8549bbb512aa5808992d60796612e25e0691dcd71e3ba67b6e92c32782df909" }, "downloads": -1, "filename": "expbackoff-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b8bed1808e382eb9fa8bd6da2ba3f2d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2545, "upload_time": "2016-12-19T13:30:24", "url": "https://files.pythonhosted.org/packages/96/2f/8fd314cc28e264e6c090095546bec1e076c72c38ced175b00244cddb6e4f/expbackoff-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b8bed1808e382eb9fa8bd6da2ba3f2d6", "sha256": "b8549bbb512aa5808992d60796612e25e0691dcd71e3ba67b6e92c32782df909" }, "downloads": -1, "filename": "expbackoff-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b8bed1808e382eb9fa8bd6da2ba3f2d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2545, "upload_time": "2016-12-19T13:30:24", "url": "https://files.pythonhosted.org/packages/96/2f/8fd314cc28e264e6c090095546bec1e076c72c38ced175b00244cddb6e4f/expbackoff-0.1.1.tar.gz" } ] }