diff options
-rw-r--r-- | lib/rainbows/epoll.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb index 39c3a27..54d08fb 100644 --- a/lib/rainbows/epoll.rb +++ b/lib/rainbows/epoll.rb @@ -12,10 +12,15 @@ module Rainbows::Epoll autoload :ResponsePipe, 'rainbows/epoll/response_pipe' autoload :ResponseChunkPipe, 'rainbows/epoll/response_chunk_pipe' + def self.quit! + Rainbows.quit! + EP.close unless EP.closed? + end + def init_worker_process(worker) super Rainbows::Epoll.const_set :EP, SleepyPenguin::Epoll.new - trap(:QUIT) { Rainbows.quit!; EP.close unless EP.closed? } + trap(:QUIT) { Rainbows::Epoll.quit! } Rainbows::Client.__send__ :include, Client end |