upcoming env['rack.input'] improvements
normalperson at yhbt.net
Fri Nov 12 19:29:17 EST 2010
The next versions of Unicorn and Rainbows! will support intentionally
violating the Rack 1.x spec and allowing non-rewindable input bodies
(config directive name not finalized, feedback appreciated)
in the Unicorn/Rainbows! config file. This will allow applications to
handle larger, streamed requests without worrying about disk/memory
usage at all. For Rack 1.x conformance, this rewindable_input directive
true by default (but will probably be off with Rack 2.x).
Rainbows! will also support HTTP/1.1 keepalive for requests with a body,
but only if the body (and trailers) are fully consumed by the
The implementation of Unicorn::TeeInput is also simplified and based on
Unicorn::StreamInput. However there is one minor regression to TeeInput
made in the interest of simplicity that will not noticeable to most
users: calling env['rack.input'].rewind causes the entire request to be
buffered if any data has previously been read off env['rack.input'].
Evented concurrency options (e.g: :Rev and :EventMachine) continue to
buffer the entire body in the existing way, and are unaffected by any
of these changes (except keepalive will always function).
More information about the rainbows-talk