File: base.py

package info (click to toggle)
python-botocore 1.37.9%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 121,768 kB
  • sloc: python: 73,696; xml: 14,880; javascript: 181; makefile: 155
file content (26 lines) | stat: -rw-r--r-- 797 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class BaseRetryBackoff:
    def delay_amount(self, context):
        """Calculate how long we should delay before retrying.

        :type context: RetryContext

        """
        raise NotImplementedError("delay_amount")


class BaseRetryableChecker:
    """Base class for determining if a retry should happen.

    This base class checks for specific retryable conditions.
    A single retryable checker doesn't necessarily indicate a retry
    will happen.  It's up to the ``RetryPolicy`` to use its
    ``BaseRetryableCheckers`` to make the final decision on whether a retry
    should happen.
    """

    def is_retryable(self, context):
        """Returns True if retryable, False if not.

        :type context: RetryContext
        """
        raise NotImplementedError("is_retryable")