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

HTTP::Response::Body#each and BUFFER_SIZE #782

Open
andyundso opened this issue Apr 9, 2024 · 0 comments
Open

HTTP::Response::Body#each and BUFFER_SIZE #782

andyundso opened this issue Apr 9, 2024 · 0 comments

Comments

@andyundso
Copy link

andyundso commented Apr 9, 2024

Hello!

The readpartial method, which each uses allows to overwrite the size of the chunks (defaults to BUFFER_SIZE). Would you accept a PR where the size can also be passed to each?

On a similar note: Right now, the BUFFER_SIZE is configured to 16KB. I tried to figure out how this value came to be, since 16KB is not a lot, but was not really able to find an answer in the code. Is there any downside to increasing this value to e.g. 4 MB?

Background: We provide an API in one of our applications where we stream large files from a 3rd party API using your gem and ActionController::Live. These files tend to be couple of gigabytes in size, so only sending 16 KB at a time results in many requests.

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

1 participant