-
Notifications
You must be signed in to change notification settings - Fork 534
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
Document token.Wait behaviour during reconnect #565
Conversation
9496984
to
6eb33f5
Compare
README.md
Outdated
@@ -129,6 +129,7 @@ may lead to messages being silently dropped. | |||
* `persistence` - Defaults to false (messages will not survive a broker restart) | |||
* `max_keepalive` - defaults to 65535 and, from version 2.0.12, `SetKeepAlive(0)` will result in a rejected connection | |||
by default. | |||
* `token.Wait()` - Will return successfully before a message has been delivered if the client needs to reconnect to the broker before the message has been delivered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move up above the "If using Mosquitto then there are a range of fairly common issues:" line (as this is not specific to Mosquitto). I would suggest something like the following (to mirror the format of previous comments and reflect the impact of options):
Publish tokens will complete if the connection is lost and re-established using the default options.SetAutoReconnect(true)
functionality (token.Error()
will return nil
). Attempts will be made to re-deliver the message but there is currently no easy way to monitor this.
When a connection is lost to the broker and later resumed the token returned to the user will be considered completed and a new token will be created instead. The result of this is that there is no way for a user of this library to know whether a message has been delivered in the presence of connection issues. Signed-off-by: Linus <[email protected]>
6eb33f5
to
ccf1d3d
Compare
When a connection is lost to the broker and later resumed the token
returned to the user will be considered completed and a new token will
be created instead. The result of this is that there is no way for a
user of this library to know whether a message has been delivered in the
presence of connection issues.
This PR documents the behavior found in #563