(encode-universal-time 0 0 0 1 1 3000)
The default time limit for NEXT-TIME searches.
Return the next time according to SCHEDULE or NIL
if there is no next time. If ALLOW-NOW-P the earliest possible time to
be returned is NOW, else it is usually NOW + the resolution of the
schedule. The default value of NOW is (GET-UNIVERSAL-TIME),
ALLOW-NOW-P is NIL and LIMIT is *DEFAULT-NEXT-TIME-LIMIT*
Return a `scheduler' function of no arguments that returns times
from NOW on by repeatedly calling NEXT-TIME on SCHEDULE. ALLOW-NOW-P
is passed to the first invocation of NEXT-TIME.
Create a timer just as with TRIVIAL-TIMERS:MAKE-TIMER but schedule
and reschedule FUNCTION according to SCHEDULER that is a function of
no parameters that returns a universal time or NIL. The returned timer
can be shut down with TRIVIAL-TIMERS:UNSCHEDULE-TIMER.
A cron-like schedule. See MAKE-CRON-SCHEDULE for details.
- The bumpers in decoded time component order.
Construct a cron-like scheduler from the SECOND, MINUTE, etc
bumpers for components of decoded times (using the default time zone
for the time being). A bumper in its most generic from a function of
three arguments: the current value, the whole decoded time, and the
index of the current value in the decoded time. A bumper is expected
to return the smallest value that is valid for that component and not
less than the current value or NIL if it cannot find a valid value.
Returning a value that is smaller than the current one is the same as
returning NIL. A bumper can simply be a number which is equivalent to
Bumpers are not allowed to depend on `lower' components of the decoded
time. The allowed dependency graph is this:
SECOND -> MINUTE -> HOUR -> (DAY-OF-MONTH <-> DAY-OF-WEEK) -> MONTH -> YEAR
That is, the SECOND bumper may look at the whole decoded time but the
MINUTE bumper may not look at seconds. DAY-OF-WEEK and DAY-OF-MONTH
may depend on each other to allow specifying the 'last Friday of the
The resolution of the schedule is defined implicitly by the lowest
bumper. NEXT-TIME always bumps the component of the decoded time that
belongs to the lowest bumper before trying to find mathces if its
LAST-TIME argument is not NIL. Of course, DAY-OF-WEEK is the odd one
out: it is the day-of-month component that is bumped if DAY-OF-WEEK is
the lowest bumper.
This scheme allows (MAKE-CRON-SCHEDULE :MONTH 12) trigger only once
per year instead of every second in December. For a more packed
schedule one can use the symbol '* as a bumper: (MAKE-CRON-SCHEDULE
:HOUR '* :MONTH 12) which makes hour the lowest bumper and the
schedule triggers every hour in December.
It is an error if all bumpers are NIL.
Return the first valid value not less than VALUE that is of TYPE.
Return a bumper function suitable for MAKE-CRON-SCHEDULE that
returns the first valid value according to TYPE. Convenience function
on top of FIND-DECODED-TIME-COMPONENT-BY-TYPE.
A convenience function much like MAKE-CRON-SCHEDULE but assumes
that no bumper can be a function designator so it must be a number,
the symbol * or a type specifier in which case it calls
MAKE-TYPED-CRON-BUMPER on it providing a terser syntax.