-
Notifications
You must be signed in to change notification settings - Fork 112
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
Efficiently writing s3 object to file #35
Comments
This old s3 wrapper has a maybe we could take some of the code from there? |
Yeah, there should be such possibility when downloading objects indeed. I've recently added upload streaming, I'll try to take a look at downloads as well. If you have some idea of solving it, you can write appropriate patch ;-). Thanks for suggestion. |
Sounds good. I'm not too good at this type of stuff, but I can try to hack together some code taken from marcel's library. Might make more sense to let you handle it though ;-) |
Ok, after digging around a bit, it looks like its pretty easy. You just have to call read_body on the HTTPResponse and give it a block. so the change would be in parse_headers. It should avoid explicitly calling response.body as this belongs in the content accessor. then we can add a stream_content accessor that takes block which is then passed along to HTTPResponse piece of cake, i'll submit a patch |
Sounds great! :-) |
Up ! :) |
s3 really needs a way to stream content to a file somehow. Loading .content on a large file pretty much puts everything in memory and destroys any heroku worker that it touches. (they cap at 300mb memory limit)
Something like this would be awesome:
especially if it could avoid loading the entire content into memory at once
The text was updated successfully, but these errors were encountered: