about summary refs log tree commit homepage
path: root/lib/rainbows/epoll.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/epoll.rb')
-rw-r--r--lib/rainbows/epoll.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb
new file mode 100644
index 0000000..8698f78
--- /dev/null
+++ b/lib/rainbows/epoll.rb
@@ -0,0 +1,22 @@
+# -*- 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::EvCore.setup
+    Rainbows::Client.__send__ :include, Client
+    Server.run
+  end
+end