rev: split out further into separate files for reuse
[rainbows.git] / t / worker-follows-master-to-death.ru
blobed2a51971f2faef2997390b2e31949e4fccc8e92
1 use Rack::ContentLength
2 headers = { 'Content-Type' => 'text/plain' }
3 run lambda { |env|
4   /\A100-continue\z/i =~ env['HTTP_EXPECT'] and return [ 100, {}, [] ]
5   env['rack.input'].read
7   case env["PATH_INFO"]
8   when %r{/sleep/(\d+)}
9     (case env['rainbows.model']
10     when :Revactor
11       Actor
12     else
13       Kernel
14     end).sleep($1.to_i)
15   end
16   [ 200, headers, [ "#$$\n" ] ]