Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LazyRequestBody breaks streaming #112

Closed
tarcieri opened this issue Jul 28, 2013 · 2 comments
Closed

LazyRequestBody breaks streaming #112

tarcieri opened this issue Jul 28, 2013 · 2 comments

Comments

@tarcieri
Copy link
Contributor

As is, LazyRequestBody accumulates the request body as an array of strings:

https://github.com/seancribbs/webmachine-ruby/blob/master/lib/webmachine/adapters/lazy_request_body.rb#L32

This is problematic for large request bodies that we'd like to stream and process incrementally since it holds on to the entire request body in memory and thus it can never get garbage collected.

-- aside --

I've been trying to sort out streaming in Reel (especially now that we have pipelining support). This is the API I'd like to support: a socket-like one with #read and #readpartial:

celluloid/reel#75

What sort of method contract should we expect from a body supplied by a Webmachine adapter? I really like the "It's just a socket" approach.

@seancribbs
Copy link
Member

@tarcieri Have we resolved this? LazyRequestBody no longer buffers.

@tarcieri
Copy link
Contributor Author

Yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants