rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob ee20085f9517700bbca1ca43bd0802486d947fcc 244 bytes (raw)
$ git show HEAD:t/t9101.ru	# shows this blob on the CLI

1
2
3
4
5
6
7
8
9
 
use Rack::ContentLength
use Rack::ContentType, 'text/plain'
use Rainbows::ThreadTimeout, :timeout => 1, :threshold => -1
run lambda { |env|
  if env["PATH_INFO"] =~ %r{/([\d\.]+)\z}
    Rainbows.sleep($1.to_f)
  end
  [ 200, [], [ "HI\n" ] ]
}

git clone https://yhbt.net/rainbows.git