Closed Tangerino closed 2 years ago
Sorry I don't have the strength to write a more detailed answer but as far as timeouts for .publish() goes, take a look at: https://github.com/peterhinch/micropython-mqtt/blob/master/mqtt_as/mqtt_as_timeout.py
And for a more advanced timeout implementation with optionally returning if the connection is down (but this one is on my fork, best to stick with the above link): https://github.com/kevinkk525/micropython-mqtt/blob/master/mqtt_as_timeout_concurrent.py
Hi.
This library works like a charm. My only comment is in the function:
When there is an error, for instance, If the broker is not available, the
client.publish
does not ever return.This is bad since the client may need to do other stuff, such as store the payload to the disk and retry later.
Can we add one more argument and tell the library to generate an exception so the client can take the actions accordingly?
Or add a timeout in:
Thanks