Sha256: 3670207f67484c2af04c1afea8153732ba83f5ba36fea28f71d7b5e6633efdad

Contents?: true

Size: 567 Bytes

Versions: 10

Compression:

Stored size: 567 Bytes

Contents

##
# 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
class EventLoop::Timer

  attr_reader :time, :callback
  attr_accessor :start_time

  # Init a timer with a time period and callback
  # @param [Float] time timeout length
  # @yield proc to call when callbacks
  def initialize(time, &callback)
    @time = time
    @callback = callback
    @start_time = Float::INFINITY
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
murasaki-0.2.2 lib/murasaki/timer.rb
murasaki-0.2.1.1 lib/murasaki/timer.rb
murasaki-0.2.1 lib/murasaki/timer.rb
murasaki-0.2.0 lib/murasaki/timer.rb
murasaki-0.1.0 lib/murasaki/timer.rb
em-midori-0.3.0 lib/midori/core_ext/timer.rb
em-midori-0.2.4 lib/midori/core_ext/timer.rb
em-midori-0.2.3 lib/midori/core_ext/timer.rb
em-midori-0.2.2 lib/midori/core_ext/timer.rb
em-midori-0.2.1 lib/midori/core_ext/timer.rb