lib/sync/reactor.rb
def perform
      return EM.next_tick{ yield } if running?
      cleanly_shutdown_reactor
      condition = new_cond
      Thread.new do
        EM.run do
          EM.next_tick do
            synchronize do
              condition.signal
            end
          end
        end
      end
      synchronize do
        condition.wait_until { EM.reactor_running? }
        EM.next_tick { yield }
      end
    end
# Execute EventMachine bound code block, waiting for reactor to start if
# not yet started or reactor thread has gone away
Execute EventMachine bound code block, waiting for reactor to start if
not yet started or reactor thread has gone away
Execute EventMachine bound code block waiting for reactor to start if not yet started or reactor thread has gone away
def perform
      return EM.next_tick{ yield } if running?
      cleanly_shutdown_reactor
      condition = new_cond
      Thread.new do
        EM.run do
          EM.next_tick do
            synchronize do
              condition.signal
            end
          end
        end
      end
      synchronize do
        condition.wait_until { EM.reactor_running? }
        EM.next_tick { yield }
      end
    end
def perform return EM . next_tick { yield } if running? cleanly_shutdown_reactor condition = new_cond Thread . new do EM . run do EM . next_tick do synchronize do condition . signal end end end end synchronize do condition . wait_until { EM . reactor_running? } EM . next_tick { yield } end end
Execute EventMachine bound code block, waiting for reactor to start if
not yet started or reactor thread has gone away
Execute EventMachine bound code block waiting for reactor to start if not yet started or reactor thread has gone away