gmqtt
gmqtt copied to clipboard
Newer example code
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