Changeset 194
- Timestamp:
- 06/03/06 15:46:31 (2 years ago)
- Files:
-
- experiments/NewMachine/lib/machine/event.rb (modified) (1 diff)
- experiments/NewMachine/lib/machine/reactor.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
experiments/NewMachine/lib/machine/event.rb
r187 r194 50 50 end 51 51 52 # Process all of the events in the run queue. 52 # Process all of the events that are in the run queue 53 # when this method starts. 54 # (We can easily add more events to ourself as we process existing 55 # ones, but that can lead to infinite loops.) 53 56 def iterate 54 while event = @event_q.shift do 57 n_events = @event_q.size 58 n_events.times do 59 event = @event_q.shift 55 60 log.debug "running handlers for event: #{event.class}" 56 61 experiments/NewMachine/lib/machine/reactor.rb
r192 r194 17 17 # Uncomment the implementation when we come up with a test case 18 18 # that needs it. 19 # 20 # TODO: There's a big problem with clear_dispatchers: it also 21 # clears out the system-dispatchers we need, like TimerContainer and 22 # EventableIO. 23 # 19 24 class Reactor 20 25 include LogSupport … … 74 79 def iterate 75 80 log.debug "iterating #{@dispatchers.size} dispatchers..." 76 @running = true 77 @dispatchers.each {|d| d.iterate if running?} 78 #@signalled = false 81 @dispatchers.each {|d| d.iterate} 79 82 end 80 83
