gmqtt icon indicating copy to clipboard operation
gmqtt copied to clipboard

Newer example code

Open gstein opened this issue 3 years ago • 0 comments

This PR provides a new revision of the sample code that has a few key features:

  • construct the gmqtt.Client() outside of the run loop
  • graceful shutdown of the client, and clearing of all tasks so that loop.close() does not throw errors
  • switch to .run_forever() instead of the singular gmqtt task, providing an example for other tasks to run in the same event loop
  • removal of the STOP event, in favor of the loop's built-in stopping mechanism

gstein avatar Feb 07 '22 12:02 gstein