Class: Nervion::WaitCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/nervion/reconnection_scheduler.rb

Direct Known Subclasses

HttpWaitCalculator, NetworkWaitCalculator

Instance Method Summary collapse

Constructor Details

#initialize(max_wait, &calculator) ⇒ WaitCalculator

Returns a new instance of WaitCalculator.



56
57
58
59
# File 'lib/nervion/reconnection_scheduler.rb', line 56

def initialize(max_wait, &calculator)
  @max_wait = max_wait
  @calculator = calculator
end

Instance Method Details

#wait_after(error_count) ⇒ Object



61
62
63
# File 'lib/nervion/reconnection_scheduler.rb', line 61

def wait_after(error_count)
  cap_wait @max_wait, calculate_wait_after(error_count)
end