class IO::Event::Timers::Handle

A handle to a scheduled timer.

def < other

@returns [Boolean] Whether the handle is less than the other handle.
@parameter other [Handle] The other handle to compare with.

Compare the handle with another handle.
def < other
	@time < other.time
end

def > other

@returns [Boolean] Whether the handle is greater than the other handle.
@parameter other [Handle] The other handle to compare with.

Compare the handle with another handle.
def > other
	@time > other.time
end

def call(...)

Invoke the block.
def call(...)
	@block.call(...)
end

def cancel!

Cancel the timer.
def cancel!
	@block = nil
end

def cancelled?

@returns [Boolean] Whether the timer has been cancelled.
def cancelled?
	@block.nil?
end

def initialize(time, block)

@parameter block [Proc] The block to call.
@parameter time [Float] The time at which the block should be called.

Initialize the handle with the given time and block.
def initialize(time, block)
	@time = time
	@block = block
end