Module: CMDx::Retriers::BoundedRandom Private
- Extended by:
- BoundedRandom
- Included in:
- BoundedRandom
- Defined in:
- lib/cmdx/retriers/bounded_random.rb
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.
Bounded-random jitter. Produces a uniform delay in ‘[delay, 2*delay]`. Guarantees at least the base delay between attempts while still decorrelating retry timing.
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/bounded_random.rb', line 18 def call(_attempt, delay, _prev_delay = nil) delay + (rand * delay) end |