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

Public Member Functions

def __init__ (self, *strategies)
 
def __call__ (self, retry_state)
 
- Public Member Functions inherited from wait_base
def __add__ (self, other)
 
def __radd__ (self, other)
 

Data Fields

 strategies
 

Detailed Description

Chain two or more waiting strategies.

If all strategies are exhausted, the very last strategy is used
thereafter.

For example::

    @retry(wait=wait_chain(*[wait_fixed(1) for i in range(3)] +
                           [wait_fixed(2) for j in range(5)] +
                           [wait_fixed(5) for k in range(4)))
    def wait_chained():
        print("Wait 1s for 3 attempts, 2s for 5 attempts and 5s
               thereafter.")

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
strategies 
)

Member Function Documentation

◆ __call__()

def __call__ (   self,
  retry_state 
)

Reimplemented from wait_base.

Field Documentation

◆ strategies

strategies

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