From 2260d56329b036bcce7eb69831d3e480334d283c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 14 May 2010 18:12:51 -0700 Subject: add WriterThreadPool concurrency model This is based on an idea I originally had for Unicorn but never implemented in Unicorn since the benefits were unproven and the risks were too high. --- t/GNUmakefile | 1 + t/simple-http_WriterThreadPool.ru | 9 +++++++++ t/t0200-async-response.sh | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 t/simple-http_WriterThreadPool.ru (limited to 't') diff --git a/t/GNUmakefile b/t/GNUmakefile index 1c979b3..6540aa0 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -22,6 +22,7 @@ else endif export RUBYLIB RUBY_VERSION +models += WriterThreadPool models += ThreadPool models += ThreadSpawn models += Rev diff --git a/t/simple-http_WriterThreadPool.ru b/t/simple-http_WriterThreadPool.ru new file mode 100644 index 0000000..0514db4 --- /dev/null +++ b/t/simple-http_WriterThreadPool.ru @@ -0,0 +1,9 @@ +use Rack::ContentLength +use Rack::ContentType +run lambda { |env| + if env['rack.multithread'] && env['rainbows.model'] == :WriterThreadPool + [ 200, {}, [ Thread.current.inspect << "\n" ] ] + else + raise "rack.multithread is false" + end +} diff --git a/t/t0200-async-response.sh b/t/t0200-async-response.sh index de5a7de..a1c5928 100755 --- a/t/t0200-async-response.sh +++ b/t/t0200-async-response.sh @@ -2,7 +2,7 @@ CONFIG_RU=${CONFIG_RU-'async-response.ru'} . ./test-lib.sh -skip_models Base +skip_models Base WriterThreadPool case $CONFIG_RU in *no-autochunk.ru) -- cgit v1.2.3-24-ge0c7