New submission from slytomcat:

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. 

Run method of threading.Timer should look like:

    def run(self):
        """Continue execution after wait till function returns True"""
        while(not self.finished.wait(self.interval)):
            if not self.function(*self.args, **self.kwargs):
                break
        self.finished.set()

----------
components: Library (Lib)
messages: 287858
nosy: slytomcat
priority: normal
severity: normal
status: open
title: threading.Timer class: Continue periodical execution till action returns 
True
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29569>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to