twisted.application.internet.backoffPolicy(initialDelay=1.0, maxDelay=60.0, factor=1.5, jitter=_goodEnoughRandom)
function documentationtwisted.application.internet
View Source
A timeout policy for ClientService
which computes an exponential backoff interval with configurable
parameters.
Parameters | initialDelay | Delay for the first reconnection attempt (default 1.0s). (type: float ) |
maxDelay | Maximum number of seconds between connection attempts (default 60 seconds,
or one minute). Note that this value is before jitter is applied, so the
actual maximum possible delay is this value plus the maximum possible
result of jitter() . (type: float ) | |
factor | A multiplicative factor by which the delay grows on each failed reattempt.
Default: 1.5. (type: float ) | |
jitter | A 0-argument callable that introduces noise into the delay. By default,
random.random , i.e. a pseudorandom floating-point value
between zero and one. (type: 0-argument callable returning float ) | |
Returns | a 1-argument callable that, given an attempt count, returns a floating
point number; the number of seconds to delay. (type: see ClientService.__init__ 's
retryPolicy argument.) | |
Present Since | 16.1.0 |