This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年12月05日 19:36 by carlosmf.pt, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| sched2.py | carlosmf.pt, 2012年12月05日 19:43 | |||
| Messages (3) | |||
|---|---|---|---|
| msg177002 - (view) | Author: Carlos Ferreira (carlosmf.pt) | Date: 2012年12月05日 19:36 | |
The sched module available in the Python core lacks a simple but very useful which is waiting for new events scheduling. Current version only process events that are present in the queue before the schedule.run() is issued or for events that are schedule while the scheduler is still active and processing events from the queue. I propose a simple enhancement, by using an Event object from the threading module, so that the thread that is running the scheduler, waits for new events scheduling, after finishing processing all queued events. The sched2.py is a modified version of the original sched.py (modified by means of a large hammer), which adds an "alwaysRunning" argument in the object constructor, a self.wakeUpEvent attribute which is the Event Object, a modified eterabs method to call the Event.set() and finally, a modified run() to wait for new events. This modification is just a quick patch in order to pass the idea of what is being requested here. If there is a better way to do this, then it should be taken. |
|||
| msg177003 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2012年12月05日 19:39 | |
See also issue16165. |
|||
| msg177004 - (view) | Author: Carlos Ferreira (carlosmf.pt) | Date: 2012年12月05日 19:43 | |
Sorry, wrong file issued before... |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:39 | admin | set | github: 60825 |
| 2021年10月21日 21:59:38 | iritkatriel | set | status: open -> closed superseder: sched.scheduler.run() blocks scheduler resolution: duplicate stage: resolved |
| 2012年12月05日 19:43:04 | carlosmf.pt | set | files:
+ sched2.py messages: + msg177004 |
| 2012年12月05日 19:42:28 | carlosmf.pt | set | files: - sched2.py |
| 2012年12月05日 19:39:54 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg177003 versions: + Python 3.4, - Python 3.3 |
| 2012年12月05日 19:36:59 | carlosmf.pt | create | |