Module: CMDx::Retriers::FullRandom Private

Extended by:
FullRandom
Included in:
FullRandom
Defined in:
lib/cmdx/retriers/full_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.

Full-random jitter. Produces a uniform delay in ‘[0, delay]`. Maximizes spread at the cost of occasional very-fast retries.

Instance Method Summary collapse

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.

Parameters:

  • _attempt (Integer)

    ignored

  • delay (Float)

    base delay in seconds

  • _prev_delay (Float, nil) (defaults to: nil)

    ignored

Returns:

  • (Float)

    computed delay



17
18
19
# File 'lib/cmdx/retriers/full_random.rb', line 17

def call(_attempt, delay, _prev_delay = nil)
  rand * delay
end