about summary refs log tree commit homepage
path: root/lib/rainbows/epoll.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-20 15:27:46 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-20 15:29:15 -0800
commit1b024d48169442a5498d490699ea1eee41563587 (patch)
tree9caf357edc4990015f19e286ffb20aa38c417d94 /lib/rainbows/epoll.rb
parentea4a01df8b1fa29e2088816f4734bb0073eb9380 (diff)
downloadrainbows-1b024d48169442a5498d490699ea1eee41563587.tar.gz
This allows us to gracefully shutdown more quickly.
Diffstat (limited to 'lib/rainbows/epoll.rb')
-rw-r--r--lib/rainbows/epoll.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb
index 52216b3..2f1d4a7 100644
--- a/lib/rainbows/epoll.rb
+++ b/lib/rainbows/epoll.rb
@@ -15,6 +15,7 @@ module Rainbows::Epoll
 
   def worker_loop(worker) # :nodoc:
     init_worker_process(worker)
+    trap(:QUIT) { Rainbows.quit!; State::EP.close unless State::EP.closed? }
     Rainbows::Client.__send__ :include, Client
     Server.run
   end