diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-05-16 20:05:12 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-05-16 20:05:12 +0000 |
commit | f9de85b9a35c9f95b390249ea855858c5e4a3ae2 (patch) | |
tree | 0626bc1ce9e1a4152b8dd9e460077b2f20eb3bf3 /lib/rainbows.rb | |
parent | 49b60d6f67a94560a802c6ff80c16c92093de877 (diff) | |
download | rainbows-f9de85b9a35c9f95b390249ea855858c5e4a3ae2.tar.gz |
Just close the epoll descriptor, since the sleepy_penguin epoll_wait wrapper may not return EINTR in the future.
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r-- | lib/rainbows.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb index 18c9b06..ff80c08 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -87,6 +87,11 @@ module Rainbows @cur = 0 @tick_mod = 0 @expire = nil + @at_quit = [] + + def self.at_quit(&block) + @at_quit << block + end def self.tick @tick_io.chmod(@tick_mod = 0 == @tick_mod ? 1 : 0) @@ -104,6 +109,7 @@ module Rainbows Rainbows::HttpParser.quit @expire = Time.now + (@server.timeout * 2.0) Unicorn::HttpServer::LISTENERS.each { |s| s.close rescue nil }.clear + @at_quit.each { |task| task.call } end false end |