Document token.Wait behaviour during reconnect - #565
Merged
Conversation
ecksun
force-pushed
the
docs/token_wait
branch
2 times, most recently
from
December 6, 2021 21:05
9496984 to
6eb33f5
Compare
MattBrittan
reviewed
Dec 6, 2021
| * `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. |
Contributor
There was a problem hiding this comment.
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.
MattBrittan
reviewed
Dec 6, 2021
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 <linus@wallgren.eu>
ecksun
force-pushed
the
docs/token_wait
branch
from
December 8, 2021 20:47
6eb33f5 to
ccf1d3d
Compare
This was referenced Jun 5, 2022
This was referenced Jun 18, 2022
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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