OpenQuizz
Une application de gestion des contenus pédagogiques
wait_random_exponential Class Reference
Inheritance diagram for wait_random_exponential:
Collaboration diagram for wait_random_exponential:

Public Member Functions

def __call__ (self, retry_state)
 
- Public Member Functions inherited from wait_exponential
def __init__ (self, multiplier=1, max=_utils.MAX_WAIT, exp_base=2, min=0)
 
- Public Member Functions inherited from wait_base
def __add__ (self, other)
 
def __radd__ (self, other)
 

Additional Inherited Members

- Data Fields inherited from wait_exponential
 multiplier
 
 min
 
 max
 
 exp_base
 

Detailed Description

Random wait with exponentially widening window.

An exponential backoff strategy used to mediate contention between multiple
uncoordinated processes for a shared resource in distributed systems. This
is the sense in which "exponential backoff" is meant in e.g. Ethernet
networking, and corresponds to the "Full Jitter" algorithm described in
this blog post:

https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

Each retry occurs at a random time in a geometrically expanding interval.
It allows for a custom multiplier and an ability to restrict the upper
limit of the random interval to some maximum value.

Example::

    wait_random_exponential(multiplier=0.5,  # initial window 0.5s
                            max=60)          # max 60s timeout

When waiting for an unavailable resource to become available again, as
opposed to trying to resolve contention for a shared resource, the
wait_exponential strategy (which uses a fixed interval) may be preferable.

Member Function Documentation

◆ __call__()

def __call__ (   self,
  retry_state 
)

Reimplemented from wait_exponential.


The documentation for this class was generated from the following file: