You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to check if my QoS 1 messages were delivered to my broker. From the documentation it is not clear to me, when the call to DeliveryToken::wait will return. Is it immediately when the message was sent to the broker or after the broker has successfully sent an ACK for that message?
In the C library you can register a callback for this with MQTTAsync_setDeliveryCompleteCallback(), see here but I cannot find the equivalent callback registration on the async_client. Is this planned to be implemented or does somebody know a workaround?
The text was updated successfully, but these errors were encountered:
The token completes when the transaction is finished, So:
QoS 0, completes immediately.
QoS 1, completes when the PUBACK is received
QoS 2, completes when the PUBCOMP is received
I didn't expose all the callbacks because I have trying to move the library away from requiring them. Although they still make sense in C, they seem to make much less sense in a Rust async world. And they are extremely problematic with their limitations (no blocking calls) and tread synchronization issues.
But I could probably add the missing ones to make a full consistent API before moving on to a v2.0 that is more purely async/await.
I thought the MQTTAsync_setDeliveryCompleteCallback() was a bit redundant. I believe it could be done more uniformly by providing succes/failure callbacks, similar to the connect_with_callbaks().
For the moment, the solution is to spawn a task to wait on the Token (which implements the Future trait), and then fire a callback, if that's what you want.
Hello,
I am trying to check if my QoS 1 messages were delivered to my broker. From the documentation it is not clear to me, when the call to
DeliveryToken::wait
will return. Is it immediately when the message was sent to the broker or after the broker has successfully sent an ACK for that message?In the C library you can register a callback for this with
MQTTAsync_setDeliveryCompleteCallback()
, see here but I cannot find the equivalent callback registration on theasync_client
. Is this planned to be implemented or does somebody know a workaround?The text was updated successfully, but these errors were encountered: