about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-05-14 18:12:51 -0700
committerEric Wong <normalperson@yhbt.net>2010-05-14 18:17:09 -0700
commit2260d56329b036bcce7eb69831d3e480334d283c (patch)
tree9db171bc4fa5886afb5135abb896d12a605707b5 /t
parent01ee5327c018f64fa4b6aa767c0328c56f699170 (diff)
downloadrainbows-2260d56329b036bcce7eb69831d3e480334d283c.tar.gz
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.
Diffstat (limited to 't')
-rw-r--r--t/GNUmakefile1
-rw-r--r--t/simple-http_WriterThreadPool.ru9
-rwxr-xr-xt/t0200-async-response.sh2
3 files changed, 11 insertions, 1 deletions
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)