about summary refs log tree commit homepage
path: root/t/t9000.ru
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-25 19:01:34 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-25 19:07:01 -0800
commitdd2b2274ef0cd8a121cf7655ade939a1f63bc971 (patch)
tree053dbbd07b6dc3b1339f1ea19ad22afd8add52f3 /t/t9000.ru
parent7f11b212f78a5070bea17bc20af43395b6cc621d (diff)
downloadrainbows-dd2b2274ef0cd8a121cf7655ade939a1f63bc971.tar.gz
This enables the safe use of Rainbows::AppPool with all
concurrency models, not just threaded ones.  AppPool is now
effective with *all* Fiber-based concurrency models including
Revactor (and of course the new Fiber{Pool,Spawn} ones).
Diffstat (limited to 't/t9000.ru')
-rw-r--r--t/t9000.ru13
1 files changed, 8 insertions, 5 deletions
diff --git a/t/t9000.ru b/t/t9000.ru
index af6b4fc..4ca36c1 100644
--- a/t/t9000.ru
+++ b/t/t9000.ru
@@ -1,13 +1,16 @@
 use Rack::ContentLength
 use Rack::ContentType
 use Rainbows::AppPool, :size => ENV['APP_POOL_SIZE'].to_i
-sleep_class = ENV['SLEEP_CLASS']
-sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel
 class Sleeper
   def call(env)
-    sleep_class = ENV['SLEEP_CLASS']
-    sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel
-    sleep_class.sleep 1
+    (case env['rainbows.model']
+    when :FiberPool, :FiberSpawn
+      Rainbows::Fiber
+    when :Revactor
+      Actor
+    else
+      Kernel
+    end).sleep(1)
     [ 200, {}, [ "#{object_id}\n" ] ]
   end
 end