Adafruit_CircuitPython_MiniMQTT icon indicating copy to clipboard operation
Adafruit_CircuitPython_MiniMQTT copied to clipboard

consider setting default non zero value for timeout in loop()

Open vladak opened this issue 2 years ago • 3 comments

Looks like the timeout=0 in loop() caused some unexpected behavior https://forums.adafruit.com/viewtopic.php?p=954996#p954996. Maybe it should be considered setting this to non-zero default ?

vladak avatar Jan 08 '23 23:01 vladak

It looks like in the sockets that timeout=0 is blocking, which seems different than how CPython handles it. It may be worth changing that to keep compatibility, I'll try to remember to bring it up at the next CircuitPython weekly meeting.

tekktrik avatar Jan 12 '23 21:01 tekktrik

Marking as a bug for now because of the above, and at the very least it doesn't do what the docstring says (0 should be non-blocking according to that).

tekktrik avatar Jan 12 '23 21:01 tekktrik

see my comment in https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/issues/138#issuecomment-2316163967 as it might solve the issue with timeout=0

evilworm avatar Aug 29 '24 06:08 evilworm

This issue can be closed given the default timeout in loop() was changed to 1 in 3ec6d2c5.

vladak avatar Jan 19 '25 10:01 vladak