Represents a cancellable handle for a specific timer event.
# File lib/timers/events.rb, line 32 def > other @time > other.to_f end
Cancel this timer, O(1).
# File lib/timers/events.rb, line 21 def cancel! # The simplest way to keep track of cancelled status is to nullify the # callback. This should also be optimal for garbage collection. @callback = nil end
Has this timer been cancelled? Cancelled timer’s don’t fire.
# File lib/timers/events.rb, line 28 def cancelled? @callback.nil? end
Generated with the Darkfish Rdoc Generator 2.