class EventLoop::Timer
Timer
Object in EventLoop
@!attribute [r] time
@return [Float] timeout length
@!attribute [r] callback
@return [Proc] proc to call when callbacks
@!attribute start_time
@return [Float] when timer should callbacks
Attributes
callback[R]
start_time[RW]
time[R]
Public Class Methods
new(time, &callback)
click to toggle source
Init a timer with a time period and callback @param [Float] time timeout length @yield proc to call when callbacks
# File lib/murasaki/timer.rb, line 17 def initialize(time, &callback) @time = time @callback = callback @start_time = Float::INFINITY end