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

Do not use Finch.async_request with Stream #235

Closed
hissssst opened this issue Jul 20, 2023 · 1 comment · Fixed by #238
Closed

Do not use Finch.async_request with Stream #235

hissssst opened this issue Jul 20, 2023 · 1 comment · Fixed by #238

Comments

@hissssst
Copy link

I can see that you've added Finch.async_request and doc even states this as a way to go to use it with Stream.resource, but

The biggest problem

It doesn't lazily read the data from socket on demand, it just sends whole response body into message queue which can just overflow the server. Any huge (let's say 1TB) response will just shut down any program using this approach. And people usually use Stream for these kind of problems (requesting huge files). So this is just misleading and has nothing to do with stream, please remove this from your documentation

@josevalim
Copy link
Contributor

We should mention that async_request works as a firehose, it will immediately send messages as they come to the current process. I think discouraging its usage with Stream is fine. And we should mention Finch.stream as an option to lazily stream.

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

Successfully merging a pull request may close this issue.

2 participants