1class BaseRetryBackoff:
2 def delay_amount(self, context):
3 """Calculate how long we should delay before retrying.
4
5 :type context: RetryContext
6
7 """
8 raise NotImplementedError("delay_amount")
9
10
11class BaseRetryableChecker:
12 """Base class for determining if a retry should happen.
13
14 This base class checks for specific retryable conditions.
15 A single retryable checker doesn't necessarily indicate a retry
16 will happen. It's up to the ``RetryPolicy`` to use its
17 ``BaseRetryableCheckers`` to make the final decision on whether a retry
18 should happen.
19 """
20
21 def is_retryable(self, context):
22 """Returns True if retryable, False if not.
23
24 :type context: RetryContext
25 """
26 raise NotImplementedError("is_retryable")