[issue16621] sched module enhancement request

Carlos Ferreira report at bugs.python.org
Wed Dec 5 20:36:59 CET 2012


New submission from Carlos Ferreira:

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.

----------
components: Library (Lib)
files: sched2.py
messages: 177002
nosy: carlosmf.pt
priority: normal
severity: normal
status: open
title: sched module enhancement request
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file28214/sched2.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16621>
_______________________________________


More information about the Python-bugs-list mailing list