eclipse-paho / eclipse-paho/paho.mqtt.python

Suggestion: Add the ability to call a user supplied method at regular intervals in loop_forever()

Open
#787 6 comments 0 reactions 0 assignees View on GitHub
Status: Available Type: Enhancement
Dominant language
Python
Stars
2.4k
Forks
742
Avg merge
12d 48m
Merged PRs (30d)
1

Description

Given that use of loop() is discouraged (and reading the code for loop_forever I can see why) and that it can be tricky to ensure use of loop_start() is thread safe, it would be helpful for loop_forever() to accept an optional argument of a function that, if provided is called regularly to perform any additional functionality that the program needs.

From my limited understanding of the code it looks as though this could be achieved by testing if the function exists and if so calling it just after the call to loop() in loop_forever()

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.