Module: CMDx::Retriers::Fibonacci Private
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Fibonacci backoff. Sleeps ‘delay * fib(attempt + 1)` where `fib(1) == 1`, `fib(2) == 1`, `fib(3) == 2`, … Multipliers grow as 1, 1, 2, 3, 5, 8. Slower-growing than exponential, faster-growing than linear.
Instance Method Summary collapse
-
#call(attempt, delay, _prev_delay = nil) ⇒ Float
private
Computed delay.
Instance Method Details
#call(attempt, delay, _prev_delay = nil) ⇒ Float
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns computed delay.
18 19 20 |
# File 'lib/cmdx/retriers/fibonacci.rb', line 18 def call(attempt, delay, _prev_delay = nil) delay * sequence(attempt + 1) end |