rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob bc68ed1d9655da69fbb045e543d4b0d2110f45aa 447 bytes (raw)
$ git show v3.0.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)
    env[RACK_INPUT] = 0 == hp.content_length ? NULL_IO : IC.new(self, hp)
    env[CLIENT_IO] = self
  end
end

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