diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-24 17:00:51 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-24 17:00:51 -0800 |
commit | 04b8649b3750a0002094e90a62f7566059c8a4e9 (patch) | |
tree | 3f41f268ac8d70b35a26834b04cae62f2183fd6c /lib/rainbows/epoll.rb | |
parent | 85ccfbc75abc78f977583db6303e3fb270fd2ec9 (diff) | |
download | rainbows-04b8649b3750a0002094e90a62f7566059c8a4e9.tar.gz |
We'll be using this more in the future
Diffstat (limited to 'lib/rainbows/epoll.rb')
-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 |