summary refs log tree commit homepage
path: root/lib/rainbows/xepoll_thread_pool.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-09 00:02:51 +0000
committerEric Wong <normalperson@yhbt.net>2011-05-09 00:02:51 +0000
commit380ef63bc2c8f7b6f1cab7387aa9343bc5720c9c (patch)
tree4d82b6448c63c36bdfb18336d8d437fb3fcd04d6 /lib/rainbows/xepoll_thread_pool.rb
parentdf00f2b1028ba95450246c82e468878b6ec903a3 (diff)
This is probably friendlier on server resources in the worst
case than XEpollThreadSpawn but may perform worse in the client
client-visible way, too.
Diffstat (limited to 'lib/rainbows/xepoll_thread_pool.rb')
-rw-r--r--lib/rainbows/xepoll_thread_pool.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/rainbows/xepoll_thread_pool.rb b/lib/rainbows/xepoll_thread_pool.rb
new file mode 100644
index 0000000..5ce89a0
--- /dev/null
+++ b/lib/rainbows/xepoll_thread_pool.rb
@@ -0,0 +1,20 @@
+# -*- encoding: binary -*-
+require "thread"
+require "sleepy_penguin"
+require "raindrops"
+
+module Rainbows::XEpollThreadPool
+  include Rainbows::Base
+
+  def init_worker_process(worker)
+    super
+    require "rainbows/xepoll_thread_pool/client"
+    Rainbows::Client.__send__ :include, Client
+  end
+
+  def worker_loop(worker) # :nodoc:
+    init_worker_process(worker)
+    Client.loop
+  end
+end
+