about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-09 00:21:23 +0000
committerEric Wong <normalperson@yhbt.net>2011-05-09 00:21:23 +0000
commit9afcdde9a92f817330e4dfd5e1ef77a7bf461253 (patch)
tree5b58530a05cf73f2fdbdf55bd86b9acd9a741cdd
parent725adcc6986bc2658d92ea3ebebe61d2b83060ad (diff)
We're now able to configure the number of threads independently
of worker_connections.
-rw-r--r--lib/rainbows/xepoll_thread_pool.rb1
-rw-r--r--lib/rainbows/xepoll_thread_pool/client.rb2
-rwxr-xr-xt/t0041-optional-pool-size.sh2
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/rainbows/xepoll_thread_pool.rb b/lib/rainbows/xepoll_thread_pool.rb
index 5ce89a0..b6eb55d 100644
--- a/lib/rainbows/xepoll_thread_pool.rb
+++ b/lib/rainbows/xepoll_thread_pool.rb
@@ -5,6 +5,7 @@ require "raindrops"
 
 module Rainbows::XEpollThreadPool
   include Rainbows::Base
+  extend Rainbows::PoolSize
 
   def init_worker_process(worker)
     super
diff --git a/lib/rainbows/xepoll_thread_pool/client.rb b/lib/rainbows/xepoll_thread_pool/client.rb
index b2c5928..1bfb1c2 100644
--- a/lib/rainbows/xepoll_thread_pool/client.rb
+++ b/lib/rainbows/xepoll_thread_pool/client.rb
@@ -33,7 +33,7 @@ module Rainbows::XEpollThreadPool::Client
   end
 
   QUEUE = Queue.new
-  APP_POOL = (1..20).each { Thread.new { app_run(QUEUE) } }
+  Rainbows::O[:pool_size].times { Thread.new { app_run(QUEUE) } }
 
   ep = SleepyPenguin::Epoll
   EP = ep.new
diff --git a/t/t0041-optional-pool-size.sh b/t/t0041-optional-pool-size.sh
index c074676..f5f6400 100755
--- a/t/t0041-optional-pool-size.sh
+++ b/t/t0041-optional-pool-size.sh
@@ -2,7 +2,7 @@
 . ./test-lib.sh
 
 case $model in
-NeverBlock|CoolioThreadPool) ;;
+NeverBlock|CoolioThreadPool|XEpollThreadPool) ;;
 *)
         t_info "skipping $model.$T since it doesn't support :pool_size"
         exit