Class: Nervion::ErrorCounter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit) ⇒ ErrorCounter

Returns a new instance of ErrorCounter.



38
39
40
41
# File 'lib/nervion/reconnection_scheduler.rb', line 38

def initialize(limit)
  @count = 0
  @limit = limit
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



36
37
38
# File 'lib/nervion/reconnection_scheduler.rb', line 36

def count
  @count
end

Instance Method Details

#notify_errorObject



43
44
45
46
# File 'lib/nervion/reconnection_scheduler.rb', line 43

def notify_error
  @count += 1
  raise TooManyConnectionErrors if too_many_errors?
end