Created
December 25, 2011 02:02
-
-
Save no6v/1518627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "eventmachine" | |
EventMachine.run do | |
Thread.new do | |
begin | |
system("cat") | |
rescue Exception => e | |
p e | |
ensure | |
EventMachine.stop_event_loop | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v em.rb | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] | |
^C$ | |
$ | |
$ ruby -v em.rb | |
ruby 2.0.0dev (2011-12-25 trunk 34120) [x86_64-linux] | |
^C/home/nov/.rvm/gems/ruby-head@earthquake/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine': Interrupt | |
from /home/nov/.rvm/gems/ruby-head@earthquake/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run' | |
from em.rb:3:in `<main>' | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment