Parent

Methods

Unicorn::PrereadInput

This middleware is used to ensure input is buffered to memory or disk (depending on size) before the application is dispatched by entirely consuming it (from TeeInput) beforehand.

Usage (in config.ru):

require 'unicorn/preread_input'
if defined?(Unicorn)
  use Unicorn::PrereadInput
end
run YourApp.new

Public Class Methods

new(app) click to toggle source
# File lib/unicorn/preread_input.rb, line 15
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/unicorn/preread_input.rb, line 19
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.