Permalink
Browse files

Add trap for int for autorun bots

  • Loading branch information...
1 parent ff47424 commit de500beea69388da1c673e88b4c90c5d610e3d04 @raggi committed Nov 13, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/talker_bot/autorun.rb
@@ -9,4 +9,9 @@
config :room, ARGV.first
-at_exit { EM.run { @bot.run } }
+at_exit do
+ EM.run {
+ trap('INT') { EM.stop if EM.reactor_running?; exit }
+ @bot.run
+ }
+end

0 comments on commit de500be

Please sign in to comment.