Class: Unicorn::PrereadInput
- Inherits:
-
Object
- Object
- Unicorn::PrereadInput
- Defined in:
- lib/unicorn/preread_input.rb
Overview
run YourApp.new
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ PrereadInput
constructor
:stopdoc:.
Constructor Details
#initialize(app) ⇒ PrereadInput
:stopdoc:
18 19 20 |
# File 'lib/unicorn/preread_input.rb', line 18 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/unicorn/preread_input.rb', line 22 def call(env) buf = "" input = env["rack.input"] if input.respond_to?(:rewind) true while input.read(16384, buf) input.rewind end @app.call(env) end |