-
Notifications
You must be signed in to change notification settings - Fork 105
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
Connecting sockets to non-existing endpoints does not work #73
Comments
This is the tough one. Should |
I think modeling it after how libzmq does things, but making things idiomatic for Rust and taking care to make error handling idiomatic, is the right approach. I'm unsure of exactly what that would entail and thats easier said than done, but I'll start by enumerating some relevant details I can dig up from libzmq, which may help us figure out what our approach should be. From http://api.zeromq.org/4-3:zmq-connect
From that same link:
zmq_socket_monitor sets up a |
I'd say thats a feature, not a bug. The user can stay connected to a non-existent endpoint and their messages will continue to get queued. Connection, reconnection, etc are handled asynchronously without any effort - which means there aren't really any errors to send back to the caller of In this way of viewing things, any asynchronous errors are really just internal to our codebase, and shouldn't impact the user of the library. Other than figuring out how the user interacts with the mute state of the socket, I'm not sure that any such error-handling for the asynchronous connection, disconnection, or reconnection would ever need to be exposed in the public api, with the exception of rust equivalent of |
To make my thoughts a bit more explicit, here's what I think we should plan for:
|
This enables us to connect socket to server that doesn't exist yet.
This enables us to connect socket to server that doesn't exist yet.
This enables us to connect socket to server that doesn't exist yet.
Implement connect_forever in util. Related to #73
In ZMQ, you can connect to an endpoint before any socket has actually bound to that endpoint. That lets you avoid all sorts of ordering issues with sockets. Currently, at least the
SubSocket
will fail to connect to non-existent endpoints. We should instead have the sockets compliant with ZMTP:From https://rfc.zeromq.org/spec/23/ on general socket semantics:
From https://rfc.zeromq.org/spec/29/ on Subscriber semantics:
The text was updated successfully, but these errors were encountered: