Return a backoff duration that is constant for all iterations.
Return a backoff duration that is constant for all iterations. For a duration of 5 seconds
Iteration | Backoff |
0 | 5 seconds |
1 | 5 seconds |
2 | 5 seconds |
3 | 5 seconds |
4 | 5 seconds |
number of the iteration, starting at 0
non-negative duration, returned by the function, optional argument which defaults to a constant defined in the root config
returns the @param duration
Returns a backoff duration that increases exponentially for each iteration.
Returns a backoff duration that increases exponentially for each iteration.
For a duration of 5 seconds
Iteration | Backoff |
0 | 5 seconds |
1 | 20 seconds |
2 | 40 seconds |
3 | 80 seconds |
4 | 160 seconds |
number of the iteration, starting at 0
non-negative duration. Scales the exponential function vertically. For a duration of 2 seconds, the backoff is doubled
@param duration * 2 power (@param iteration) duration
If math.pow(2,iteration) is near Double.MaxValue overflow can happen
Returns a backoff duration that increases in the same way as the fibonacci sequence does, using an approximation for the concrete fibonacci sequence.
Returns a backoff duration that increases in the same way as the fibonacci sequence does, using an approximation for the concrete fibonacci sequence.
For a duration of 5 seconds
Iteration | Backoff |
0 | 5.00 seconds |
1 | 8.09 seconds |
2 | 13.09 seconds |
3 | 21.18 seconds |
4 | 34.27 seconds |
4 | 55.45 seconds |
number of the iteration, starting at 0
non-negative duration. Scales the fibonacci sequence vertically.
@param duration*(fibonacci(@param iteration) + fibonacci(@param iteration - 1))
If math.pow(2,iteration) is near Double.MaxValue overflow can happen
Returns a backoff duration that increases linearly for each iteration.
Returns a backoff duration that increases linearly for each iteration. For a duration of 5 seconds
Iteration | Backoff |
0 | 0 seconds |
1 | 5 seconds |
2 | 10 seconds |
3 | 15 seconds |
4 | 20 seconds |
number of the iteration, starting at 0
non-negative duration. Defines the increase in time for each unit of duration, optional argument which defaults to a constant defined in the root config
@param duration * @param iteration
Backoff is used to calculate the next duration to wait before trying to resend a request using different functions, all of which, receive an integer as the iteration number and a duration as the vertical scaling factor.