rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob d9904e8e22cf7d4f38b89e6824b90f69f72f3b8d 321 bytes (raw)
$ git show HEAD:t/heartbeat-timeout.ru	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
use Rack::ContentLength
headers = { 'Content-Type' => 'text/plain' }
run lambda { |env|
  case env['PATH_INFO']
  when "/block-forever"
    Process.kill(:STOP, $$)
    sleep # in case STOP signal is not received in time
    [ 500, headers, [ "Should never get here\n" ] ]
  else
    [ 200, headers, [ "#$$\n" ] ]
  end
}

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