Method: HTTP::Retriable::DelayCalculator#initialize

Defined in:
lib/http/retriable/delay_calculator.rb

#initialize(opts) ⇒ DelayCalculator

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 a new instance of DelayCalculator.



7
8
9
10
11
12
13
14
# File 'lib/http/retriable/delay_calculator.rb', line 7

def initialize(opts)
  @max_delay = opts.fetch(:max_delay, Float::MAX).to_f
  if (delay = opts[:delay]).respond_to?(:call)
    @delay_proc = opts.fetch(:delay)
  else
    @delay = delay
  end
end