mcollina / mqtt-level-store

Store your in-flight MQTT message on Level, for Node
MIT License
24 stars 11 forks source link

How to know when all messages have been sent? #9

Closed abcd-ca closed 6 years ago

abcd-ca commented 6 years ago

Hi, I have had good success with this library. I have a device that sometimes goes offline for long periods and upon reconnecting sends its mqtt messages that were queued in the mqtt-level-store. This works.

What I am missing is a way to know when it's safe to power-off my device. I want to be able to know if all mqtt messages have been sent from the store or if it's still busy sending. Is there a hook for this already that you can point me to? Otherwise, is there a particular place in the source code you can point me to to develop it myself?

Thanks!

abcd-ca commented 6 years ago

moving this over to the mqtt.js project