Parameters: |
|
---|
Scheduler watchers are specialised Periodic watchers. Each time the Scheduler gets scheduled, the reshedule callback (scheduler) will be called with the watcher as first, and the current time as second argument. Example:
def myscheduler(watcher, now):
return now + 60.0
Scheduler(myscheduler, ...)
This can be used to create very complex timers, such as a timer that triggers on ‘next midnight, local time’. To do this, you would calculate the next midnight after now and return the timestamp value for this. This cannot be done with Timer watchers, as those cannot react to time jumps.
Simply stops and restarts the periodic watcher again. This is only useful when scheduler would return a different time than the last time it was called (e.g. in a crond like program when the crontabs have changed).
The current reschedule callback. Can be changed any time.
Its signature must be:
Parameters: |
|
---|
It must return a float greater than or equal to the now argument to indicate the next time the watcher callback should be scheduled. It will usually be called just before the callback will be triggered, but might be called at other times, too.
Warning
Read only
When the watcher is active, this is the absolute time that this watcher is supposed to trigger next.