schedule-functionPortable Threadsscheduled-function-nameschedule-function-relativeGoTo Top

schedule-function-relative   name-or-scheduled-function seconds &key repeat-interval verbose[Function]

Purpose
Schedule a scheduled function a specified number of seconds from now.

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 object
seconds     A positive integer
repeat-interval     A positive integer (representing seconds) or nil (default is nil)
verbose     A generalized boolean (default is *schedule-function-verbose*)

Errors
Threads (multiprocessing) is not supported on the Common Lisp implementation.

Description
If the scheduled-function object is unscheduled, it is added to the list of currently scheduled scheduled functions with an invocation time of interval seconds from the current time and the specified repeat-interval. If the scheduled-function object is currently scheduled, it is first unscheduled and then rescheduled with an invocation time of interval seconds from the current time and the specified repeat-interval.

See also
    *schedule-function-verbose*
    all-scheduled-functions
    make-scheduled-function
    restart-scheduled-function-scheduler
    schedule-function
    scheduled-function-repeat-interval
    spawn-periodic-function
    unschedule-function

Examples
Schedule a scheduled function that simply prints "Hello!" 5 seconds from now:

  > (schedule-function-relative
      (make-scheduled-function
        #'(lambda (scheduled-function)
            (declare (ignore scheduled-function))
            (print "Hello!")))
       5)
  >
Schedule a scheduled function that signals a GBBopen timer-interrupt-event every 30 seconds:
  > (schedule-function-relative
      (make-scheduled-function
        #'(lambda (scheduled-function)
            (declare (ignore scheduled-function))
            (signal-event 'timer-interrupt-event)))
      30
      :repeat-interval 30)
  >

Note
The form (schedule-function-relative scheduled-function 10) is equivalent to (schedule-function scheduled-function (+ (get-universal-time) 10)).


The GBBopen Project


schedule-functionPortable Threadsscheduled-function-nameschedule-function-relativeGoTo Top