diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:55 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:55 -0700 |
commit | 7a3ebef424f3e7db0a48ae35885c446d79b7d971 (patch) | |
tree | f5cbaa3cd99833ed39a5076a580d20a1d978f27f /t/sleep.ru | |
parent | 08c52c81bc49023a645dd211c4c983a60ac64e13 (diff) | |
download | rainbows-7a3ebef424f3e7db0a48ae35885c446d79b7d971.tar.gz |
Since we export "rainbows.model" to Rack now, we don't have to worry about setting the "SLEEP_CLASS" env for the application.
Diffstat (limited to 't/sleep.ru')
-rw-r--r-- | t/sleep.ru | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,11 +1,16 @@ use Rack::ContentLength use Rack::ContentType -sleep_class = ENV['SLEEP_CLASS'] -sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel -$stderr.puts "sleep_class=#{sleep_class.inspect}" + run lambda { |env| nr = 1 env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f - sleep_class.sleep(nr) + + (case env['rainbows.model'] + when :Revactor + Actor + else + Kernel + end).sleep(nr) + [ 200, {}, [ "Hello\n" ] ] } |