Skip to content

Instantly share code, notes, and snippets.

@ssoroka
Created March 18, 2011 21:14
Show Gist options
  • Save ssoroka/876864 to your computer and use it in GitHub Desktop.
Save ssoroka/876864 to your computer and use it in GitHub Desktop.
dead simple em-synchrony evented console. woop
$:<< '../lib' << 'lib'
require 'rubygems'
require 'eventmachine'
require 'em-synchrony'
EM.run {
EM.synchrony {
loop do
begin
print "> "
s = gets.chomp
# command_stack.push(s)
p(eval(s))
rescue
print "#{$!.class.name}: #{$!.message}\n #{$!.backtrace.join(%(\n ))}\n"
end
end
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment