Class: EventMachine::Reactor

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/em_pure_ruby.rb

Instance Method Summary collapse

Instance Method Details

#run_timersObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ext/em_pure_ruby.rb', line 6

def run_timers
  timers_to_delete = []
  @timers.each {|t|
    if t.first <= @current_loop_time
      #@timers.delete t
      timers_to_delete << t
      EventMachine::event_callback "", TimerFired, t.last
    else
      break
    end
  }
  timers_to_delete.map{|c| @timers.delete c}
  timers_to_delete = nil
  #while @timers.length > 0 and @timers.first.first <= now
  #  t = @timers.shift
  #  EventMachine::event_callback "", TimerFired, t.last
  #end
end