-
Notifications
You must be signed in to change notification settings - Fork 8
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
Don't use blocking recv #2
Comments
Need to see if this has any performance impact when reading big bulk strings and similar. I am not sure if the reading process really needs to be part of the supervision tree or if it is ok to just put the gen_servers under supervision |
Yes, we should try this in an isolated test: A minimal example program just sending data to a server that's streaming it back. Three versions would be nice:
Supervision is not a must for any process, but it makes the design more robust. If it turns out version 2 is faster, I think we can live with spawn_link for the receiving process. Btw, how likely is it than |
The note on gen_tcp:send gives the impression that it will not block, at least not in the send buffer full scenario. |
True, in only blocks if the socket backend is used. Maybe we want to support that in the future though. |
but
|
When
gen_tcp:recv
(orssl:recv
) is used, the process can't respond to supervisor events. We should use{active, once}
or{active, N}
instead.We use one process to send data to a socket and another to receive the responses. Currently the sending process is the controlling process. We should make the receive process the controlling process instead, because
gen_tcp:send
can block.The text was updated successfully, but these errors were encountered: