From 725adcc6986bc2658d92ea3ebebe61d2b83060ad Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 May 2011 00:17:06 +0000 Subject: split out pool_size module coolio_thread_pool, neverblock both use it, and xepoll_thread_pool will support it next, too. --- lib/rainbows/pool_size.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/rainbows/pool_size.rb (limited to 'lib/rainbows/pool_size.rb') diff --git a/lib/rainbows/pool_size.rb b/lib/rainbows/pool_size.rb new file mode 100644 index 0000000..8089869 --- /dev/null +++ b/lib/rainbows/pool_size.rb @@ -0,0 +1,14 @@ +# -*- encoding: binary -*- +# :stopdoc: +module Rainbows::PoolSize + DEFAULTS = { + :pool_size => 50, # same as the default worker_connections + } + + def setup + o = Rainbows::O + DEFAULTS.each { |k,v| o[k] ||= v } + Integer === o[:pool_size] && o[:pool_size] > 0 or + raise ArgumentError, "pool_size must a be an Integer > 0" + end +end -- cgit v1.2.3-24-ge0c7