lib/packet/packet_core.rb
# method starts event loop in the process
method starts event loop in the process
method starts event loop in the process
def start_reactor
        Signal.trap("TERM") { terminate_me }
        Signal.trap("INT") { shutdown }
        loop do
          check_for_timer_events
          @on_next_tick.call if @on_next_tick
          ready_read_fds,ready_write_fds,read_error_fds = select(read_ios,write_ios,[],0.05)
          if ready_read_fds && !ready_read_fds.empty?
            handle_read_event(ready_read_fds)
          elsif ready_write_fds && !ready_write_fds.empty?
            handle_write_event(ready_write_fds)
          end
        end
      end
def start_reactor Signal . trap ( "TERM" ) { terminate_me } Signal . trap ( "INT" ) { shutdown } loop do check_for_timer_events @on_next_tick . call if @on_next_tick ready_read_fds , ready_write_fds , read_error_fds = select ( read_ios , write_ios , [ ] , 0.05 ) if ready_read_fds && ! ready_read_fds . empty? handle_read_event ( ready_read_fds ) elsif ready_write_fds && ! ready_write_fds . empty? handle_write_event ( ready_write_fds ) end end end
method starts event loop in the process
method starts event loop in the process