| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…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 repeat_until which takes some callback indicating when to finish execution. By default it will have some value to indicate only 1 repeat of callback execution. |
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.
| if not self.finished.is_set(): | ||
| self.function(*self.args, **self.kwargs) | ||
| """Continue execution after wait until function returns True""" | ||
| while(not self.finished.wait(self.interval)): |
There was a problem hiding this comment.
Try to add test case when this is true. It might help you get 100% coverage
Sorry, something went wrong.
There was a problem hiding this comment.
Done. But: codecov/patch — 86.95% of diff hit (target 100%) - some red lines in Lib/test/test_threading.py.
I have no idea how to cover tests by tests =/
Sorry, something went wrong.
|
I have to reorganize my cloned repo so the CR have to be reissued. |
Sorry, something went wrong.
…ile clearing a thread state If Python clears a thread state and a destructor or a weakref-callback runs Python code, Python used to create a new initial stub without clearing it later. This change reorders PyThreadState_Clear() to clear the PyStacklessState sub-structure last. A new test case for this problem uses thread local storage to execute a __del__-method. https://bitbucket.org/stackless-dev/stackless/issues/121 (grafted from ede2ad2b32b917d364f523318a82c75d0df2a0e6)
| Back | FazBrowse Home | New Git URL |
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