How to use the tenacity.compat function in tenacity

To help you get started, we’ve selected a few tenacity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jd / tenacity / tenacity / __init__.py View on Github external
def wait(self):
        return _compat.wait_func_accept_retry_state(self._wait)
github jd / tenacity / tenacity / __init__.py View on Github external
def retry_error_callback(self):
        return _compat.retry_error_callback_accept_retry_state(
            self._retry_error_callback)
github jd / tenacity / tenacity / __init__.py View on Github external
def stop(self):
        return _compat.stop_func_accept_retry_state(self._stop)
github jd / tenacity / tenacity / stop.py View on Github external
    @_compat.stop_dunder_call_accept_old_params
    def __call__(self, retry_state):
        return any(x(retry_state) for x in self.stops)
github jd / tenacity / tenacity / __init__.py View on Github external
def retry(self):
        return _compat.retry_func_accept_retry_state(self._retry)
github jd / tenacity / tenacity / __init__.py View on Github external
def before(self):
        return _compat.before_func_accept_retry_state(self._before)
github jd / tenacity / tenacity / wait.py View on Github external
    @_compat.wait_dunder_call_accept_old_params
    def __call__(self, retry_state):
        result = self.start + (
            self.increment * (retry_state.attempt_number - 1)
        )
        return max(0, min(result, self.max))
github jd / tenacity / tenacity / retry.py View on Github external
def __init__(self, *retries):
        self.retries = tuple(_compat.retry_func_accept_retry_state(r)
                             for r in retries)
github jd / tenacity / tenacity / __init__.py View on Github external
def after(self):
        return _compat.after_func_accept_retry_state(self._after)
github jd / tenacity / tenacity / wait.py View on Github external
def __init__(self, *strategies):
        self.strategies = [_compat.wait_func_accept_retry_state(strategy)
                           for strategy in strategies]