Package gavo :: Package base :: Module cron :: Class Queue
[frames] | no frames]

Class Queue

source code

object --+
         |
        Queue

A cron-job queue.

This is really a heap sorted by the time the job is next supposed to run.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
runEvery(self, seconds, name, callable)
schedules callable to be run every seconds.
source code
 
repeatAt(self, times, name, callable)
schedules callable to be run every day at times.
source code
 
registerScheduleFunction(self, scheduleFunction) source code
 
clearScheduleFunction(self) source code
 
getQueueRepr(self)
returns a sequence of (startDateTime local, job name) pairs.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

runEvery(self, seconds, name, callable)

source code 

schedules callable to be run every seconds.

name must be a unique identifier for the "job". jobs with identical names overwrite each other.

callable will be run in the main thread, so it must finish quickly or it will block the server.

repeatAt(self, times, name, callable)

source code 

schedules callable to be run every day at times.

times is a list of (day-of-month, day-of-week, hour, minute) tuples. day-of-month and/or day-of-week are 1-based and may be None (if both are non-none, day-of-week wins).

name must be a unique identifier for the "job". jobs with identical names overwrite each other.

callable will be run in the main thread, so it must finish quickly or it will block the server.

getQueueRepr(self)

source code 

returns a sequence of (startDateTime local, job name) pairs.

This is for inspection/debug purposes.