summary refs log tree commit homepage
path: root/lib/rainbows/epoll.rb
blob: 52216b31a3c585301fee92d4f439b5a7ccc9c4af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- encoding: binary -*-
# :enddoc:
require 'sleepy_penguin'
require 'sendfile'

# Edge-triggered epoll concurrency model.  This is extremely unfair
# 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 worker_loop(worker) # :nodoc:
    init_worker_process(worker)
    Rainbows::Client.__send__ :include, Client
    Server.run
  end
end