Sha256: 4d5be5b3ae1a3f500fc09e29ce7299d0cc3c6f69d5d6dec6440c7a514b5eb684
Contents?: true
Size: 490 Bytes
Versions: 3
Compression:
Stored size: 490 Bytes
Contents
require 'timers' module LIFX # @private module Timers protected def initialize_timer_thread timers.after(1) {} # Just so timers.wait doesn't complain when there's no timer @timer_thread = Thread.start do loop do timers.wait end end end def stop_timers timers.each(&:cancel) if @timer_thread @timer_thread.abort end end public def timers @timers ||= ::Timers.new end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lifx-0.4.11 | lib/lifx/timers.rb |
lifx-0.4.10 | lib/lifx/timers.rb |
lifx-0.4.8 | lib/lifx/timers.rb |