rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob df51ac161e0e1c0e2d30ba7463a714e4d214a8e0 459 bytes (raw)
$ git show v2.1.0:lib/rainbows/rack_input.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
# -*- encoding: binary -*-
# :enddoc:
# only used by synchronous interfaces
module Rainbows::RackInput
  NULL_IO = Unicorn::HttpRequest::NULL_IO
  RACK_INPUT = Unicorn::HttpRequest::RACK_INPUT
  CLIENT_IO = Rainbows::Const::CLIENT_IO

  def self.setup
    const_set(:IC, Unicorn::HttpRequest.input_class)
  end

  def set_input(env, hp, client)
    env[RACK_INPUT] = 0 == hp.content_length ? NULL_IO : IC.new(client, hp)
    env[CLIENT_IO] = client
  end
end

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