From e4178814b71af92d470974bdc6071666c1c8831a Mon Sep 17 00:00:00 2001 From: eranb Date: Mon, 6 May 2013 23:03:37 +0300 Subject: [PATCH] rackup: ability to specify the number of workers using rackup generic options API, e.g -O workers=16 --- README.md | 6 ++++++ examples/websocket_rack.sh | 2 +- lib/rack/handler/reel.rb | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cbce522..8d99495 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,12 @@ by Celluloid. In addition, the Rack specification mandates that request bodies are rewindable, which prevents streaming request bodies as the spec dictates they must be written to disk. +To run `.ru` file using Reel w/ 16 workers + +``` +rackup -p 1234 -s reel config.ru -Enone -O "workers=16" +``` + To really leverage Reel's capabilities, you must use Reel via its own API, or another Ruby library with direct Reel support. diff --git a/examples/websocket_rack.sh b/examples/websocket_rack.sh index 6057108..6cb77c9 100755 --- a/examples/websocket_rack.sh +++ b/examples/websocket_rack.sh @@ -1 +1 @@ -rackup -s reel websocket.ru -Enone \ No newline at end of file +rackup -s reel websocket.ru -Enone -O "workers=16" diff --git a/lib/rack/handler/reel.rb b/lib/rack/handler/reel.rb index babaa8f..59fb521 100644 --- a/lib/rack/handler/reel.rb +++ b/lib/rack/handler/reel.rb @@ -83,6 +83,7 @@ def normalize_options(options) options = options.inject({}) { |h, (k,v)| h[k.downcase] = v ; h } options[:rackup] = options[:config] if options[:config] options[:port] = options[:port].to_i if options[:port] + options[:workers] = options[:workers].to_i if options[:workers] options end end