improved-backoff


Nameimproved-backoff JSON
Version 1.2 PyPI version JSON
download
home_pagehttps://github.com/Kirusi/improved_backoff
SummaryFork of a popular backoff library with a few fixed bugs
upload_time2023-01-30 19:26:50
maintainer
docs_urlNone
authorKirusi Msafiri
requires_python>=3.7,<4.0
licenseMIT
keywords retry backoff decorators improved_backoff
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            improved\_backoff
=================

[![image](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370)
[![image](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380)
[![image](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-390)
[![image](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100)

[![image](https://github.com/Kirusi/improved_backoff/workflows/tests/badge.svg)](https://github.com/Kirusi/improved_backoff/actions/workflows/tests.yml)
[![image](https://kirusi.github.io/improved_backoff/coverage.svg)](https://github.com/Kirusi/improved_backoff/actions/workflows/coverage.yml)
[![image](https://img.shields.io/pypi/v/improved_backoff.svg)](https://pypi.python.org/pypi/improved_backoff)
[![image](https://img.shields.io/github/license/kirusi/improved_backoff)](https://github.com/kirusi/improved_backoff/blob/master/LICENSE)

**Function decoration for backoff and retry**

This is a fork of an excellent Python library
[backoff](https://github.com/litl/backoff). The library was forked on January 26, 2023.
It includes the original version 2.2.1 (October 5, 2022) and a few extra updates.

This fork includes 2 PRs proposed in the original repo:

-   [Correct check for max\_time parameter](https://github.com/litl/backoff/pull/130)
-   [Fix some issues around max\_time in \_next\_wait](https://github.com/litl/backoff/pull/136)
-   [Using \"timeit\" module for time management](https://github.com/litl/backoff/pull/185)

The updated behavior of `max_time` is that a a function will be retried only if the elapsed time is less,
than `max_time`. Also the remaining time should exceed the `interval` (delay between retries).

The code that calculates delay time was modified to not generate negative values.
If at the time of calculation elapsed time exceeds specified `max_time` value than delay is set to zero.
If calculated delay time is negative, then it's also set to zero.

In order to use this module import it under `backoff` alias and use it
the same way as the original module

```python
import improved_backoff as backoff

@backoff.on_exception(backoff.expo, requests.exceptions.RequestException)
def get_url(url):
    return requests.get(url)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Kirusi/improved_backoff",
    "name": "improved-backoff",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "retry,backoff,decorators,improved_backoff",
    "author": "Kirusi Msafiri",
    "author_email": "kirusi.msafiri@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1d/df/1bb55a599da1ece42024d545c8a5f425e9fc235574b0d03e050c63995634/improved_backoff-1.2.tar.gz",
    "platform": null,
    "description": "improved\\_backoff\n=================\n\n[![image](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370)\n[![image](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380)\n[![image](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-390)\n[![image](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100)\n\n[![image](https://github.com/Kirusi/improved_backoff/workflows/tests/badge.svg)](https://github.com/Kirusi/improved_backoff/actions/workflows/tests.yml)\n[![image](https://kirusi.github.io/improved_backoff/coverage.svg)](https://github.com/Kirusi/improved_backoff/actions/workflows/coverage.yml)\n[![image](https://img.shields.io/pypi/v/improved_backoff.svg)](https://pypi.python.org/pypi/improved_backoff)\n[![image](https://img.shields.io/github/license/kirusi/improved_backoff)](https://github.com/kirusi/improved_backoff/blob/master/LICENSE)\n\n**Function decoration for backoff and retry**\n\nThis is a fork of an excellent Python library\n[backoff](https://github.com/litl/backoff). The library was forked on January 26, 2023.\nIt includes the original version 2.2.1 (October 5, 2022) and a few extra updates.\n\nThis fork includes 2 PRs proposed in the original repo:\n\n-   [Correct check for max\\_time parameter](https://github.com/litl/backoff/pull/130)\n-   [Fix some issues around max\\_time in \\_next\\_wait](https://github.com/litl/backoff/pull/136)\n-   [Using \\\"timeit\\\" module for time management](https://github.com/litl/backoff/pull/185)\n\nThe updated behavior of `max_time` is that a a function will be retried only if the elapsed time is less,\nthan `max_time`. Also the remaining time should exceed the `interval` (delay between retries).\n\nThe code that calculates delay time was modified to not generate negative values.\nIf at the time of calculation elapsed time exceeds specified `max_time` value than delay is set to zero.\nIf calculated delay time is negative, then it's also set to zero.\n\nIn order to use this module import it under `backoff` alias and use it\nthe same way as the original module\n\n```python\nimport improved_backoff as backoff\n\n@backoff.on_exception(backoff.expo, requests.exceptions.RequestException)\ndef get_url(url):\n    return requests.get(url)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Fork of a popular backoff library with a few fixed bugs",
    "version": "1.2",
    "split_keywords": [
        "retry",
        "backoff",
        "decorators",
        "improved_backoff"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "130caaf14a9293b900446213134c8c08c7cdf857bf2324500c658feface17aa3",
                "md5": "26fa4a39f41058dcac35e3af1fab5930",
                "sha256": "62f7203b5f4214236bdc14aa9eb53c5fee9a97519655c8021726989d9575574f"
            },
            "downloads": -1,
            "filename": "improved_backoff-1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "26fa4a39f41058dcac35e3af1fab5930",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 17497,
            "upload_time": "2023-01-30T19:26:48",
            "upload_time_iso_8601": "2023-01-30T19:26:48.465222Z",
            "url": "https://files.pythonhosted.org/packages/13/0c/aaf14a9293b900446213134c8c08c7cdf857bf2324500c658feface17aa3/improved_backoff-1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ddf1bb55a599da1ece42024d545c8a5f425e9fc235574b0d03e050c63995634",
                "md5": "a5cd55708c09d083cdd5a690e6b9fd34",
                "sha256": "c3a03bcc24853b31f5d512d5b5996d1f6ef130e0fcbfaa57b43cdaf97866e955"
            },
            "downloads": -1,
            "filename": "improved_backoff-1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a5cd55708c09d083cdd5a690e6b9fd34",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 11891,
            "upload_time": "2023-01-30T19:26:50",
            "upload_time_iso_8601": "2023-01-30T19:26:50.272640Z",
            "url": "https://files.pythonhosted.org/packages/1d/df/1bb55a599da1ece42024d545c8a5f425e9fc235574b0d03e050c63995634/improved_backoff-1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-30 19:26:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Kirusi",
    "github_project": "improved_backoff",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "improved-backoff"
}
        
Elapsed time: 0.04061s