rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob 9c70d474208a87b588397fdf147cb5ecb12033c3 404 bytes (raw)
$ git show HEAD:t/kgio-pipe-response.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
 
# must be run without Rack::Lint since that clobbers to_path
use Rainbows::DevFdResponse
run(lambda { |env|
  io = case env["rainbows.model"].to_s
  when /Fiber/
    Rainbows::Fiber::IO::Pipe
  else
    Kgio::Pipe
  end.popen('cat random_blob', 'rb')

  [ 200,
    {
      'Content-Length' => ::File.stat('random_blob').size.to_s,
      'Content-Type' => 'application/octet-stream',
    },
    io
  ]
})

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