class IO::Event::Timers

def fire(now = self.now)

def fire(now = self.now)
	# Flush scheduled timers into the heap:
	flush!
	
	# Get the earliest timer:
	while handle = @heap.peek
		if handle.cancelled?
			@heap.pop
		elsif handle.time <= now
			# Remove the earliest timer from the heap:
			@heap.pop
			
			# Call the block:
			handle.call(now)
		else
			break
		end
	end
end