LinearBackoff returns a backoff-time that is incremented by a fixed amount
with every step/retry. An optional maximum can be provided as an upper bound
to the returned backoff.
The series can be described as ('i' is the current step/retry):
backoff = initial + increment * i | without bound
backoff = initial + increment * min(i, max) | with bound
Example:
Without bound:
initial = 1000, increment = 1000
backoff = 1000 + 1000 * 0 = 1000 // first retry
backoff = 1000 + 1000 * 1 = 2000 // second retry
backoff = 1000 + 1000 * 2 = 3000 // ...increases by 'increment' with every retry
backoff = 1000 + 1000 * 3 = 4000
backoff = 1000 + 1000 * 4 = 5000
... // and so on
With bound:
initial = 1000, increment = 1000, max = 5000
backoff = 1000 + 1000 * 0 = 1000 // first retry
backoff = 1000 + 1000 * 1 = 2000 // second retry
backoff = 1000 + 1000 * 2 = 3000 // third retry
backoff = 1000 + 1000 * 3 = 4000 // fourth retry
backoff = 1000 + 1000 * 4 = 5000 // maximum reached, don't increase further
backoff = 1000 + 1000 * 4 = 5000
backoff = 1000 + 1000 * 4 = 5000
... // and so on
LinearBackoff returns a backoff-time that is incremented by a fixed amount with every step/retry. An optional maximum can be provided as an upper bound to the returned backoff.
The series can be described as ('i' is the current step/retry): backoff = initial + increment * i | without bound backoff = initial + increment * min(i, max) | with bound
Example:
Without bound: initial = 1000, increment = 1000 backoff = 1000 + 1000 * 0 = 1000 // first retry backoff = 1000 + 1000 * 1 = 2000 // second retry backoff = 1000 + 1000 * 2 = 3000 // ...increases by 'increment' with every retry backoff = 1000 + 1000 * 3 = 4000 backoff = 1000 + 1000 * 4 = 5000 ... // and so on
With bound: initial = 1000, increment = 1000, max = 5000 backoff = 1000 + 1000 * 0 = 1000 // first retry backoff = 1000 + 1000 * 1 = 2000 // second retry backoff = 1000 + 1000 * 2 = 3000 // third retry backoff = 1000 + 1000 * 3 = 4000 // fourth retry backoff = 1000 + 1000 * 4 = 5000 // maximum reached, don't increase further backoff = 1000 + 1000 * 4 = 5000 backoff = 1000 + 1000 * 4 = 5000 ... // and so on