AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
203 stars 72 forks source link

How to shut down a client gracefully? #173

Closed michaelmarconi closed 5 years ago

michaelmarconi commented 5 years ago

I'd like to gracefully shut down the MQTT client. I see an example of calling mqtt_client.shutdown(), however this method doesn't seem to exist on version 0.30.1 of this library?

tekjar commented 5 years ago

Shutdown that you see isn't graceful shutdown. Graceful shutdown isn't possible yet. I'm waiting for stable async/await to start the work.

michaelmarconi commented 5 years ago

OK. Is there any way currently to cleanly shutdown the connection to the broker then? I'm simply dropping the client, which results in an error message at the broker.

michaelmarconi commented 5 years ago

I've moved to the master branch and calling mqtt_client.shutdown() has the desired effect of sending a clean shutdown signal to the broker, thanks!