rainbows.git about / heads / tags Unicorn for sleepy apps and slow clients
blob 9e4eff1d1c29bf8c70ddf3dd12fec369896c2590 361 bytes (raw) $ git show v0.3.0:t/sleep.ru # shows this blob on the CLI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use Rack::ContentLength run lambda { |env| /\A100-continue\z/i =~ env['HTTP_EXPECT'] and return [ 100, {}, [] ] env['rack.input'].read nr = 1 env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f (case env['rainbows.model'] when :Revactor Actor else Kernel end).sleep(nr) [ 200, {'Content-Type' => 'text/plain'}, [ "Hello\n" ] ] }
git clone https://yhbt.net/rainbows.git