diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-05-09 00:02:51 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-05-09 00:02:51 +0000 |
commit | 380ef63bc2c8f7b6f1cab7387aa9343bc5720c9c (patch) | |
tree | 4d82b6448c63c36bdfb18336d8d437fb3fcd04d6 /lib/rainbows/xepoll_thread_pool.rb | |
parent | df00f2b1028ba95450246c82e468878b6ec903a3 (diff) | |
download | rainbows-380ef63bc2c8f7b6f1cab7387aa9343bc5720c9c.tar.gz |
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.rb | 20 |
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 + |