diff options
Diffstat (limited to 'lib/rainbows/epoll.rb')
-rw-r--r-- | lib/rainbows/epoll.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb index 2f1d4a7..39c3a27 100644 --- a/lib/rainbows/epoll.rb +++ b/lib/rainbows/epoll.rb @@ -7,16 +7,20 @@ require 'sendfile' # and optimized for throughput at the expense of fairness module Rainbows::Epoll include Rainbows::Base - autoload :State, 'rainbows/epoll/state' autoload :Server, 'rainbows/epoll/server' autoload :Client, 'rainbows/epoll/client' autoload :ResponsePipe, 'rainbows/epoll/response_pipe' autoload :ResponseChunkPipe, 'rainbows/epoll/response_chunk_pipe' + def init_worker_process(worker) + super + Rainbows::Epoll.const_set :EP, SleepyPenguin::Epoll.new + trap(:QUIT) { Rainbows.quit!; EP.close unless EP.closed? } + Rainbows::Client.__send__ :include, Client + end + 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 end |