From 380ef63bc2c8f7b6f1cab7387aa9343bc5720c9c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 May 2011 00:02:51 +0000 Subject: add XEpollThreadPool concurrency option This is probably friendlier on server resources in the worst case than XEpollThreadSpawn but may perform worse in the client client-visible way, too. --- lib/rainbows/xepoll_thread_pool.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/rainbows/xepoll_thread_pool.rb (limited to 'lib/rainbows/xepoll_thread_pool.rb') 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 + -- cgit v1.2.3-24-ge0c7