def on_timer
            @critical.synchronize {
                schedule = @scheduled.shift
                @schedules.delete(schedule)
                schedule.trigger

                # execute schedules that are within 3ms of this event
                # Basic timer coalescing..
                now = @reactor.now + 3
                while @scheduled.first && @scheduled.first.next_scheduled <= now
                    schedule = @scheduled.shift
                    @schedules.delete(schedule)
                    schedule.trigger
                end
                check_timer
            }
        end
def on_timer
            @critical.synchronize {
                schedule = @scheduled.shift
                @schedules.delete(schedule)
                schedule.trigger

                # execute schedules that are within 3ms of this event
                # Basic timer coalescing..
                now = @reactor.now + 3
                while @scheduled.first && @scheduled.first.next_scheduled <= now
                    schedule = @scheduled.shift
                    @schedules.delete(schedule)
                    schedule.trigger
                end
                check_timer
            }
        end
Is called when the libuv timer fires