-
Notifications
You must be signed in to change notification settings - Fork 58
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
rcvtimeo values not honored by recv #198
Comments
Duplicate of #87 |
I'm not sure what that field is for, but in general Julia is designed to give you synchronous options with lightweight Tasks so that you don't need to manage these timeouts manually. |
You mean |
|
If ZMQ_DONTWAIT is not used, msg_recv will wait for up to Even if there is a way to emulate this in julia using tasks, I still think the functionality in zmq itself should be made available. I also don't believe Julia yet has a reliable way to terminate an overrunning task easily. |
I made my own function to suit my (very simple - just a script that receives and handles values - but I know that messages arrive at least every milliseconds, so a timeout indicates a dead connection) particular use case, I'm just leaving it here in case anyone else has a similar use case.
This functions honors rcvtimeo, but probably will block a task without letting julia switch to a different one |
It seems like regardless of the value for
rcvtimeo
set,recv
is waiting for a message for ever.Example
With a local PUB socket already set up:
Expected behavior
recv gives up after 5 seconds
Actual behavior
recv hangs
More info
Using Julia Version 1.1.0
Calling
msg_recv
without the ZMQ_DONTWAIT flag, i.e. requesting blocking mode from zeromq, results in desired behavior. Although obviously you then don't have the convenience functions likerecv(socket::Socket, ::Type{T})
.Maybe having an optional argument in
recv
to not use the ZMQ_DONTWAIT flag could be a simple fix for the moment.The text was updated successfully, but these errors were encountered: