Skip to content

Instantly share code, notes, and snippets.

@PharaohKJ
Created December 25, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PharaohKJ/9cf9ab976ad7368646ec to your computer and use it in GitHub Desktop.
Save PharaohKJ/9cf9ab976ad7368646ec to your computer and use it in GitHub Desktop.
def ensure_em
unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?
Thread.new { EventMachine.run }
sleep 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment