Exemplo n.º 1
0
 def create_backoff(self, delay):
     if delay.strategy == delay.CONSTANT:
         return ConstantBackoff(delay.base_delay)
     elif delay.strategy == delay.EXPONENTIAL:
         return ExponentialBackoff(delay.base_delay)
     else:
         raise ValueError("Unknown backoff strategy '{0:s}' (options are 'constant' and 'exponential')")
Exemplo n.º 2
0
 def setUp(self):
     self.backoff = ExponentialBackoff(BASE_DELAY)