![]() | ![]() | ![]() | schedule-function | ![]() |
| &key marker context repeat-interval verbose | [Function] |
Purpose
Schedule a scheduled function at an absolute invocation time.
Package :portable-threads
Module :portable-threads
Arguments and values
name-or-scheduled-function | An object (typically a string or a
symbol) naming a currently scheduled scheduled function or a
scheduled-function | |
invocation-time | A Universal Time | |
marker | An object (default is nil )
| |
context | An object (default is nil )
| |
repeat-interval | A positive integer (representing seconds) or
nil (default is nil )
| |
verbose | A generalized boolean
(default is |
Errors
Threads (multiprocessing) is not supported on the
Common Lisp implementation.
Description
If the scheduled-function
If the scheduled-function
scheduled-function
scheduled-function
The optional context object can be specified to replace the invocation
context in the
See also
*schedule-function-verbose*
all-scheduled-functions
encode-time-of-day
make-scheduled-function
restart-scheduled-function-scheduler
schedule-function-relative
scheduled-function-repeat-interval
scheduled-function-scheduler-paused-p
scheduled-function-scheduler-running-p
spawn-periodic-function
unschedule-function
Examples
Schedule a scheduled function that simply prints
"Happy New Year!"
> (schedule-function (make-scheduled-function #'(lambda (scheduled-function) (declare (ignore scheduled-function)) (print "Happy New Year!"))) (encode-universal-time 0 0 0 1 1 2014)) > (all-scheduled-functions) (#<scheduled-function nil [Jan 1, 2014 00:00:00]>) >Schedule a scheduled function that prints
"It's quitting
time!"
> (schedule-function (make-scheduled-function #'(lambda (scheduled-function) (declare (ignore scheduled-function)) (print "It's quitting time!")) :name 'quitting-time) (encode-time-of-day 0 0 17) :repeat-interval #.(* 24 60 60)) >Verbosely change
quitting-time
> (schedule-function 'quitting-time (encode-time-of-day 0 30 17) :repeat-interval #.(* 24 60 60) :verbose 't) ;; Unscheduling #<scheduled-function quitting-time [17:00:00]>... ;; Scheduling #<scheduled-function quitting-time [17:30:00]> ;; as the next scheduled-function... >
Schedule a scheduled function that prints an individualized "Hello"
> (schedule-function (make-scheduled-function #'(lambda (scheduled-function) (format t "~&Hello ~a~%" (scheduled-function-context scheduled-function))) :name 'hello :context "Bob") (encode-time-of-day 0 0 9) :repeat-interval #.(* 24 60 60)) >Verbosely change the scheduled function to prints the individualized
"Hello"
> (schedule-function 'hello (encode-time-of-day 0 30 8) :repeat-interval #.(* 24 60 60) :context "Lisa" :verbose 't) ;; Unscheduling #<scheduled-function hello [09:00:00]>... ;; Scheduling #<scheduled-function hello [08:30:00]> ;; as the next scheduled-function... >
The GBBopen Project
![]() | ![]() | ![]() | schedule-function | ![]() |