Class: Net::SSH::Compat::TimerWatcher

Inherits:
Coolio::TimerWatcher
  • Object
show all
Defined in:
lib/pmux/mros.rb

Instance Method Summary collapse

Constructor Details

#initialize(interval, fiber, watchers) ⇒ TimerWatcher

Returns a new instance of TimerWatcher.



38
39
40
41
42
# File 'lib/pmux/mros.rb', line 38

def initialize interval, fiber, watchers
  @fiber = fiber
  @watchers = watchers
  super(interval, false)
end

Instance Method Details

#on_timerObject



44
45
46
47
# File 'lib/pmux/mros.rb', line 44

def on_timer
  for w in @watchers; w.detach; end
  @fiber.resume(nil)
end