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

ZMQ_NOBLOCK is deprecated #548

Closed
fbacchella opened this issue May 1, 2018 · 6 comments
Closed

ZMQ_NOBLOCK is deprecated #548

fbacchella opened this issue May 1, 2018 · 6 comments

Comments

@fbacchella
Copy link
Contributor

Looking at http://api.zeromq.org/2-1:zmq-send, I see that I can have no blocking send using the flag ZMQ_SNDMORE. I'm using ZMQ.Socket.send(byte[] data, int flags) I went hunting for flags value in the javadoc and found zmq.ZMQ.ZMQ_NOBLOCK. But it's deprecated. What should I use instead ? It should be in the javadoc.

@fbacchella
Copy link
Contributor Author

I found it reading the source code, it's zmq.ZMQ.ZMQ_DONTWAIT. But it should be in Javadoc, not needing to dig in the code.

@fredoboulo
Copy link
Contributor

Latest code is based on 4.1, please look at http://api.zeromq.org/4-1:zmq-send instead.

@fbacchella
Copy link
Contributor Author

That's the rational for the change, I don't argue about that. But the javadoc should give hint where to look when something is deprecated. Just add a little "changed to DONTWAIT, to comply with 4.1 API", that should be enough.

@fredoboulo
Copy link
Contributor

fredoboulo commented May 3, 2018

Pour la petite histoire, it's part of the C4 explanation by Pieter Hintjens:
http://zguide.zeromq.org/page:all#Evolution-of-Public-Contracts

Jeromq started by implementing 3.x, so NOBLOCK may never have been present, it was already deprecated from the very beginning.

More constructively, adding javadoc in send and recv methods may even make more sense, but it would be kinda duplicated in several places: zmq.ZMQ static methods, zmq.SocketBase, org.zeromq.ZMQ.Socket, and I may have forgotten some of them.

EDIT: Until now, I focused javadoc writing inside org.zeromq package, that may be enough.

fredoboulo added a commit to fredoboulo/jeromq that referenced this issue May 3, 2018
@sigiesec
Copy link
Member

sigiesec commented May 4, 2018

What does "comply with 4.1 API" mean? Do you refer to the libzmq API? There is no language-neutral API specification AFAIK, so the JeroMQ API can only be "inspired by" some version of the libzmq API.

@fbacchella
Copy link
Contributor Author

In the version 4.1, the constant is called ZMQ_DONTWAIT, in 2.1, it's called ZMQ_NOBLOCK. Jeromq stick to that and they're right.

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