spawn-periodic-functionScheduled and Periodic Functionsunschedule-functionGoTo Top

unschedule-function   name-or-scheduled-function &key marker warnp verbose => boolean[Function]

Purpose
Cancel the upcoming invocation (and subsequent repeat-interval scheduling) of a currently scheduled scheduled function.

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
marker     An object (default is nil)
verbose     A generalized boolean (default is *schedule-function-verbose*)
warnp     A generalized boolean (default is t)
boolean     A generalized boolean

Returns
The scheduled function if it was unscheduled; nil if the scheduled function was not currently scheduled or was not found.

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

Description
If the scheduled-function object is currently scheduled, either the scheduled-function object or the optional name value that was specified when the scheduled-function object was created with make-scheduled-function can be specified as the name-or-scheduled-function value. If a name is specified as the name-or-scheduled-function value and more than one scheduled function with the specified name is currently scheduled, the scheduled function with the earliest invocation time is selected. If an optional marker value was specified along with name when the scheduled-function object was created with make-scheduled-function, the marker value can also be specified to restrict the selected scheduled function to the one with the earliest invocation time that matches both the name and marker values. The selected scheduled function is removed from the list of currently scheduled scheduled functions.

If warnp is true, a warning is issued if the scheduled function was not currently scheduled or was not found.

See also
    *schedule-function-verbose*
    all-scheduled-functions
    make-scheduled-function
    schedule-function
    schedule-function-relative

Examples
Unschedule the quitting-time scheduled function:

  > (unschedule-function 'quitting-time)
  #<scheduled-function quitting-time [unscheduled]>
  >
Unschedule all currently scheduled scheduled functions:
  > (all-scheduled-functions)
  (#<scheduled-function nil [Jan 1, 2014 00:00:00]>)
  > (mapc #'unschedule-function (all-scheduled-functions))
  (#<scheduled-function nil [unscheduled]>)
  > (all-scheduled-functions)
  nil
  >
Unschedule a non-existent scheduled function:
  > (unschedule-function 'non-existent)
  ;; Warning: Scheduled-function non-existent was not scheduled; no action taken.
  nil
  >


The GBBopen Project


spawn-periodic-functionScheduled and Periodic Functionsunschedule-functionGoTo Top