fluffysquirrels / mqtt-async-client-rs

An MQTT client written in Rust
MIT License
40 stars 16 forks source link

Add support for draining publish events before shutting down. #32

Open nathanielc opened 2 years ago

nathanielc commented 2 years ago

This change does two things:

  1. Adds logic to drain rx_io_requests on shutdown, this ensures that all outgoing requests to the MQTT broken are processed by the IoTask before the task is shutdown.
  2. Changes the behavior of a zero read from the client. A zero read does not indicate a disconnect from the broker and so this change simply ignores zero reads and continues processing.

I have been using these changes locally for a few weeks without issue now.