xepoll_thread_spawn/client: remove rdoc
[rainbows.git] / lib / rainbows / xepoll.rb
blob2b389009a0dd33c5b86277c74ed5b3200390ac5d
1 # -*- encoding: binary -*-
2 require 'raindrops'
3 require 'rainbows/epoll'
5 # Edge-triggered epoll concurrency model with blocking accept() in a
6 # (hopefully) native thread.  This is just like Epoll, but recommended
7 # for Ruby 1.9 users as it can avoid accept()-scalability issues on
8 # multicore machines with many worker processes.
9 module Rainbows::XEpoll
10   # :stopdoc:
11   include Rainbows::Base
12   autoload :Client, 'rainbows/xepoll/client'
14   def init_worker_process(worker)
15     super
16     Rainbows::Epoll.const_set :EP, SleepyPenguin::Epoll.new
17     Rainbows::Client.__send__ :include, Client
18   end
20   def worker_loop(worker) # :nodoc:
21     init_worker_process(worker)
22     Client.run
23   end
24   # :startdoc:
25 end