This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Optional | |
| def backoff(start: int, stop: int, factor: Optional[int] = 5) -> int: | |
| """ Generator for a backoff policy that increments a given start value by factor until | |
| stop is reached. | |
| :param start: Integer to start at | |
| :type start: int | |
| :param stop: Factor to increase start by | |
| :type stop: int | |
| :param factor: Integer to stop at or after |