aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-01-14 13:53:25 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-01-14 13:53:25 +0900
commitf9ece97b169e1cbb94db29fc7ced3b94f1c43190 (patch)
tree7a3c2dae106be49cc28a968c10fc578e0ba20d3b
parent23bd1de5547d85ce4ac9dc7d4f8742a24457f5d9 (diff)
downloadplum-f9ece97b169e1cbb94db29fc7ced3b94f1c43190.tar.gz
rack/handler: add Threads options to specify threadpool_size
-rw-r--r--lib/rack/handler/plum.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/rack/handler/plum.rb b/lib/rack/handler/plum.rb
index 97108a8..79cf995 100644
--- a/lib/rack/handler/plum.rb
+++ b/lib/rack/handler/plum.rb
@@ -15,7 +15,8 @@ module Rack
port: opts[:Port].to_i
}
],
- debug: !!opts[:Debug]
+ debug: !!opts[:Debug],
+ threadpool_size: opts[:Threads].to_i
)
@server = ::Plum::Rack::Server.new(app, config)
@@ -29,9 +30,10 @@ module Rack
def self.valid_options
{
- "Host=HOST" => "Hostname to listen on (default: #{default_options[:Host]})",
- "Port=PORT" => "Port to listen on (default: #{default_options[:Port]})",
- "Debug" => "Turn on debug mode (default: #{default_options[:Debug]})",
+ "Host=HOST" => "Hostname to listen on (default: #{default_options[:Host]})",
+ "Port=PORT" => "Port to listen on (default: #{default_options[:Port]})",
+ "Debug" => "Turn on debug mode (default: #{default_options[:Debug]})",
+ "Threads=N" => "Use N threads (default: #{default_options[:Threads]})",
}
end
@@ -43,6 +45,7 @@ module Rack
Host: dev ? "localhost" : "0.0.0.0",
Port: 8080,
Debug: dev,
+ Threads: 20,
}
end
end