Module: CMDx::Retriers::Linear Private

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

Linear backoff. Sleeps ‘delay * (attempt + 1)` — multiples of the base delay grow arithmetically (1x, 2x, 3x, …).

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)

    zero-based retry attempt

  • 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/linear.rb', line 17

def call(attempt, delay, _prev_delay = nil)
  delay * (attempt + 1)
end