bpo-29569: threading.Timer class: Continue periodical execution till action return True#121
bpo-29569: threading.Timer class: Continue periodical execution till action return True#121slytomcat wants to merge 6 commits into
Conversation
…action returns True.
|
I've fixed test for continuous execution of Timer class. Now check passed. |
Sorry, something went wrong.
|
I am wondering how it will influence existing code. Most of the functions currently used in Timer callback probably not returning True value. It means that they will be executed infinitely. Maybe it's better to add some new argument like |
Sorry, something went wrong.
|
No, exactly conversely - if function returns None or not True it will run only once. |
Sorry, something went wrong.
|
codecov/patch — 81.25% of diff hit (target 100%) - anybody know how to fix it? |
Sorry, something went wrong.
|
I have to reorganize my cloned repo so the CR have to be reissued. |
Sorry, something went wrong.
I think that functionality of threading.Timer class can be easily extended to generate the sequence of runs with specified period. The idea comes from the GLib.timeout_add function.
http://bugs.python.org/issue29569
As most current CB functions that are used in Timer returns nothing (None) they will run only once as earlier. Only functions that returns True will continue their periodical execution.
There are two ways to stop such continues execution:
It is my first contribution and I kindly ask to help me with required future actions.
Thanks