Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/sched.pyc |
³ò h”Rc @ s2 d Z d d k Z d g Z d d d „ ƒ YZ d S( sé A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that is supposed to implement a delay. You can implement real-time scheduling by substituting time and sleep from built-in module time, or you can implement simulated time by writing your own functions. This can also be used to integrate scheduling with STDWIN events; the delay function is allowed to modify the queue. Time can be expressed as integers or floating point numbers, as long as it is consistent. Events are specified by tuples (time, priority, action, argument). As in UNIX, lower priority numbers mean higher priority; in this way the queue can be maintained as a priority queue. Execution of the event means calling the action function, passing it the argument. Remember that in Python, multiple function arguments can be packed in a tuple. The action function may be an instance method so it has another way to reference private data (besides global variables). Parameterless functions or methods cannot be used, however. iÿÿÿÿNt schedulerc B s>