1 # -*- encoding: binary -*-
3 require 'sleepy_penguin'
6 # Edge-triggered epoll concurrency model. This is extremely unfair
7 # and optimized for throughput at the expense of fairness
10 autoload :Server, 'rainbows/epoll/server'
11 autoload :Client, 'rainbows/epoll/client'
12 autoload :ResponsePipe, 'rainbows/epoll/response_pipe'
13 autoload :ResponseChunkPipe, 'rainbows/epoll/response_chunk_pipe'
17 EP.close unless EP.closed?
20 def init_worker_process(worker)
22 Rainbows::Epoll.const_set :EP, SleepyPenguin::Epoll.new
23 trap(:QUIT) { Rainbows::Epoll.quit! }
24 Rainbows::Client.__send__ :include, Client
27 def worker_loop(worker) # :nodoc:
28 init_worker_process(worker)