Package flumotion :: Package twisted :: Module defer :: Class RetryingDeferred
[hide private]

type RetryingDeferred

source code

object --+
         |
        RetryingDeferred

Provides a mechanism to attempt to run some deferred operation until it succeeds. On failure, the operation is tried again later, exponentially backing off.

Instance Methods [hide private]
 
__init__(self, deferredCreate, *args, **kwargs)
Create a new RetryingDeferred.
source code
 
start(self)
Start trying.
source code
 
cancel(self) source code
 
_retry(self) source code
 
_success(self, val) source code
 
_failed(self, failure) source code
 
_nextDelay(self) source code
Class Variables [hide private]
  maxDelay = 1800
  initialDelay = 5.0
  factor = 2.71828182846
  jitter = 0.11962656492
  delay = None
Method Details [hide private]

__init__(self, deferredCreate, *args, **kwargs)
(Constructor)

source code 

Create a new RetryingDeferred. Will call deferredCreate(*args, **kwargs) each time a new deferred is needed.

Overrides: object.__init__

start(self)

source code 

Start trying. Returns a deferred that will fire when this operation eventually succeeds. That deferred will only errback if this RetryingDeferred is cancelled (it will then errback with the result of the next attempt if one is in progress, or a CancelledError. # TODO: yeah?