You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2020. It is now read-only.
... from my reading of the code, a call to zmq.socket("req").send(...) can lead to a "message" callback being executed. In binding.cc, this seems to be because Socket::Sendv can call socket->NotifyReadReady().
Why does the code work this way? It seems to me to break the expected flow of Node.js, which is that events will only be triggered once the event loop finishes executing the current code. The way this is designed, the execution of the current code suddenly jumps to triggering callbacks and then returns to executing the current code. Why can't it just wait until the event loop is ready to check for responses? This behaviour should at least be separated out into a new send_and_check function or something.
Following on from a question I filed on StackOverflow:
http://stackoverflow.com/questions/39573399/why-are-my-request-and-response-messages-out-of-order
... from my reading of the code, a call to zmq.socket("req").send(...) can lead to a "message" callback being executed. In binding.cc, this seems to be because Socket::Sendv can call socket->NotifyReadReady().
Why does the code work this way? It seems to me to break the expected flow of Node.js, which is that events will only be triggered once the event loop finishes executing the current code. The way this is designed, the execution of the current code suddenly jumps to triggering callbacks and then returns to executing the current code. Why can't it just wait until the event loop is ready to check for responses? This behaviour should at least be separated out into a new send_and_check function or something.