lib/sync/reactor.rb
def cleanly_shutdown_reactor
      if EM.reactor_running?
        EM.stop_event_loop
        EM.release_machine
        EM.instance_variable_set '@reactor_running', false
      end
    end
# If the reactor's thread died, EM still thinks it's running but it isn't.
# This will happen if we forked from a process that had the reator running.
# Tell EM it's dead. Stolen from the EM internals
#
# https://groups.google.com/forum/#!msg/ruby-amqp/zchM4QzbZRE/I43wIjbgIv4J
#
If the reactor's thread died, EM still thinks it's running but it isn't.
This will happen if we forked from a process that had the reator running.
Tell EM it's dead. Stolen from the EM internals


If the reactor ' s thread died EM still thinks it ' s running but it isn ' t . This will happen if we forked from a process that had the reator running . Tell EM it ' s dead . Stolen from the EM internals
def cleanly_shutdown_reactor
      if EM.reactor_running?
        EM.stop_event_loop
        EM.release_machine
        EM.instance_variable_set '@reactor_running', false
      end
    end
def cleanly_shutdown_reactor if EM . reactor_running? EM . stop_event_loop EM . release_machine EM . instance_variable_set '@reactor_running' , false end end
If the reactor's thread died, EM still thinks it's running but it isn't.
If the reactor ' s thread died EM still thinks it ' s running but it isn ' t .