New submission from Maximilian Ernestus <maximil...@ernestus.de>:

When I remove all events from a scheduler while its run() is being executed 
(with blocking=True in another thread), run() continues to block for some time 
because it is caught in its delayfunc which is time.sleep by default.

This issue can easily be solved by using the wait() function of a 
threading.Event as the delayfunc and setting the event whenever the queue 
becomes empty. The referenced pull request adds this functionality by default.

I also added a cancel_all() method which should be far more efficient than 
iterating all events and deleting them individually.

----------
components: Library (Lib)
messages: 344804
nosy: ernestum
priority: normal
pull_requests: 13738
severity: normal
status: open
title: sched.py: run() is caught in delayfunc even if all events are cancelled.
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

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

Reply via email to