-
Notifications
You must be signed in to change notification settings - Fork 86
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
Provide predicates for connection and channel status #101
Comments
I dodged this originally because the client has an async API. If all other operations are placed on a client-side queue, when would an application want to know if the client is connected - right now or after everything in the queue has been tried? It might be a confusing experience for the developer if these concepts aren't expressed in the API. We could have both an async (with a block) and immediate predicate, perhaps? |
One reason to check connection and channel state would be when you need to know if it's safe to [re-]publish a group of messages, e.g. to sync local mobile app state with that of the server. Note that it's not used to know when a connection succeeded. In other clients it's a point-in-time predicate. I think this is what #97 is asking about. |
In that case it feels to me like you'd still want to use a block, because you'd probably want to avoid trying to re-send the messages if, by the time the local queue had been processed, your connection had dropped again. Another thing to consider is the high likelihood of being in a connection recovery cycle on mobile. During recovery, none of these conditions are sufficient for knowing that it's safe to re-send:
You'd probably want to know that the entire topology had been redeclared before re-sending. Again, this doesn't seem to be covered in other clients, so maybe it isn't actually needed as much as I'm thinking. |
I'm still convinced that having a predicate for channels is a good idea and we will get requests for this again and again. |
I agree - but we should be careful about how it's implemented, or just how it's named, to avoid false / misleading return values. |
Originally filed as #97. Java, .NET, Ruby (Bunny) all provide such predicates.
The text was updated successfully, but these errors were encountered: