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
Add new callback called when message is put into outgoingStore
.
#869
Conversation
Added new callback `cbStorePut` to `publish()`. `cbStorePut` is called when message is put into `outgoingStore`. Problem: When disconnection occures right after `publish()` but `callback` is not called, then reconnect, client can't know if the message is completely stored into `outgoingStore`. Outcome: This commit fixes above problem. Client can know that message has been put into `outgoingStore` when `cbStorePut` is called.
Motivation: |
README.md
Outdated
@@ -343,7 +343,7 @@ and connections | |||
|
|||
------------------------------------------------------- | |||
<a name="publish"></a> | |||
### mqtt.Client#publish(topic, message, [options], [callback]) | |||
### mqtt.Client#publish(topic, message, [options], [callback], [cbStorePut]) |
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.
I would prefer the new callabck to be in the option instead?
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.
I changed that the callback is one of publish
method's options.
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.
LGTM
Thank you very much for merging. |
Add new callback called when message is put into `outgoingStore`.
Add new callback called when message is put into `outgoingStore`.
Added new callback
cbStorePut
topublish()
.cbStorePut
is called when message is put intooutgoingStore
.Problem:
When disconnection occures right after
publish()
butcallback
is not called, then reconnect, client can't know if the message is completely stored intooutgoingStore
.Outcome:
This commit fixes above problem.
Client can know that message has been put into
outgoingStore
whencbStorePut
is called.