Class: MessagePack::RPC::LoopUtil::Timer
- Inherits:
-
Cool.io::TimerWatcher
- Object
- Cool.io::TimerWatcher
- MessagePack::RPC::LoopUtil::Timer
- Defined in:
- lib/msgpack/rpc/loop.rb
Instance Method Summary collapse
-
#initialize(interval, repeating, &block) ⇒ Timer
constructor
A new instance of Timer.
- #on_timer ⇒ Object
Constructor Details
#initialize(interval, repeating, &block) ⇒ Timer
Returns a new instance of Timer.
29 30 31 32 |
# File 'lib/msgpack/rpc/loop.rb', line 29 def initialize(interval, repeating, &block) @block = block super(interval, repeating) end |
Instance Method Details
#on_timer ⇒ Object
33 34 35 |
# File 'lib/msgpack/rpc/loop.rb', line 33 def on_timer @block.call end |