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

socker('req').send is queued? #124

Closed
jeffrson opened this issue Feb 6, 2017 · 2 comments
Closed

socker('req').send is queued? #124

jeffrson opened this issue Feb 6, 2017 · 2 comments

Comments

@jeffrson
Copy link

jeffrson commented Feb 6, 2017

Hi,
I'm having some problem with understanding this nodejs binding and make use of it.

First, in C#, reqsock.send twice throws an exception, because it violates the pattern.

In zeromq.js, however. all reqsock.send seem to be queued. They will be executed as soon as there is a connection. Then all responses will come in in reqsocket.on('message', ...).

If there's no server, a lot of requests may queue whose response (at some time in the future) is not important anymore and may in fact cause wrong behaviour.

How is this intended to work? Is there any way to clear the queue?

Thanks

@expelledboy
Copy link

expelledboy commented Feb 17, 2017

I am trying to understand this wrapper as well, but it would seem if you want the same behaviour as in c# you would socket.send(...) async twice, and monitor for socket.on('error', ...) messages.

See the _outgoing variable on how the queue is implemented in the JS portion. However it basically gets queued in libzmq itself pretty soon after it zeromq.js gets the message, regardless of connection state.

@rolftimmermans
Copy link
Member

rolftimmermans commented Nov 4, 2019

This is addressed as of 6.0.0-beta.1, which is a reimplementation that addresses a number of fundamental issues with the previous versions of this library. For more background see #189.

I'd like to encourage you to try out the beta version and feel free to leave feedback here or in a new issue.

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

3 participants