[issue37174] sched.py: run() is caught in delayfunc even if all events are cancelled.

2019-06-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Marking this as 3.9 because it is an API change.  Also, you can already control 
the delayfunc through the current API, so I don't see the necessity of a 
changing the default which seems to work fine for most users.

Tim, what do you think?

--
nosy: +rhettinger, tim.peters
versions:  -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37174] sched.py: run() is caught in delayfunc even if all events are cancelled.

2019-06-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.6 only gets security fixes.  3.7, 3.8 only get bugfixes.  Something new 
should be a separate PR.

--
nosy: +terry.reedy
stage:  -> test needed
versions:  -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37174] sched.py: run() is caught in delayfunc even if all events are cancelled.

2019-06-06 Thread Maximilian Ernestus


New submission from Maximilian Ernestus :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com