The cl-cron Reference Manual
Table of Contents
The cl-cron Reference Manual
This is the cl-cron Reference Manual, version 0.1,
generated automatically by Declt version 3.0 "Montgomery Scott"
on Tue Dec 22 12:11:23 2020 GMT+0.
1 Systems
The main system appears first, followed by any subsystem dependency.
1.1 cl-cron
- Author
Mackram G Raydan
- License
GPL
- Description
A simple tool that provides cron like facilities directly inside of common lisp. For this to work properly note that your lisp implementation should have support for threads
- Version
0.1
- Dependency
bordeaux-threads
- Source
cl-cron.asd (file)
- Components
-
2 Files
Files are sorted by type and then listed depth-first from the systems
components trees.
2.1 Lisp
2.1.1 cl-cron.asd
- Location
cl-cron.asd
- Systems
cl-cron (system)
2.1.2 cl-cron/packages.lisp
- Parent
cl-cron (system)
- Location
packages.lisp
- Packages
cl-cron
2.1.3 cl-cron/cl-cron.lisp
- Dependency
packages.lisp (file)
- Parent
cl-cron (system)
- Location
cl-cron.lisp
- Exported Definitions
-
- Internal Definitions
-
3 Packages
Packages are listed by definition order.
3.1 cl-cron
- Source
packages.lisp (file)
- Nickname
cron
- Use List
common-lisp
- Exported Definitions
-
- Internal Definitions
-
4 Definitions
Definitions are sorted by export status, category, package, and then by
lexicographic order.
4.1 Exported definitions
4.1.1 Special variables
- Special Variable: *cron-load-file*
-
a parameter which points to a lisp or fasl file which would be loaded once start-cron is called. The boot file should be made of as many make-cron-job calls as you like one after the other in normal s-expression fashion.
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Special Variable: *cron-log-file*
-
a parameter to set the cron file log location.
- Package
cl-cron
- Source
cl-cron.lisp (file)
4.1.2 Functions
- Function: delete-cron-job CRON-KEY
-
deletes the cron job with the corresponding hash key
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: gen-list START-LIST END-LIST &optional INCREMENT
-
functions that returns a list of numbers starting with start-list and ending with end-list
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: log-cron-message MESSAGE &optional TYPE
-
Simply log the message sent with type as well
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: make-cron-job FUNCTION-SYMBOL &key MINUTE STEP-MIN HOUR STEP-HOUR DAY-OF-MONTH STEP-DOM MONTH STEP-MONTH DAY-OF-WEEK STEP-DOW BOOT-ONLY HASH-KEY
-
creates a new instance of a cron-job object and appends it to the cron-jobs-list after processing its time. Note that if you wish to use multiple values for each parameter you need to provide a list of numbers or use the gen-list function. You can not have a list of symbols when it comes to month or day-of-week. Please note that as by ANSI Common Lisp for the month variable the possible values are between 1 and 12 inclusive with January=1 and for day of week the possible values are between 0 and 6 with Monday=0. Returns the hash-key
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: max-list LST
-
finds the minimum element of a list
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: min-list LST
-
finds the minimum element of a list
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: restart-cron ()
-
function that starts up cron but without loading the file or running any of the boot only cron jobs in the list
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: start-cron ()
-
function that starts cron by first loading the cron file defined in the variable, then it runs any cron-job that has the job-only-at-boot property set to t. Finally, it starts a thread that runs cron-dispatcher
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: stop-cron ()
-
allows the stoppage of cron through the killing of the cron-dispatcher. Note that cron-dispatcher is killed only if it is sleeping otherwise we wait till the cron jobs finish. To reuse cron after calling stop-cron, you would need to recall start-cron which would go through all the steps as if cron has just booted. If you wish to prevent these actions when you restart cron then please you restart-cron.
- Package
cl-cron
- Source
cl-cron.lisp (file)
4.2 Internal definitions
4.2.1 Special variables
- Special Variable: *cron-dispatcher-processing*
-
allows us to not kill the thread unless the lock can be acquired
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Special Variable: *cron-dispatcher-thread*
-
a parameter to that holds the cron-dispatcher thread
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Special Variable: *cron-jobs-hash*
-
contains a hash of all corn-job objects that need to be run
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Special Variable: *day-list*
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Special Variable: *month-list*
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
4.2.2 Macros
- Macro: def-cron-get-methods TAG-NAME UNIT-TOTAL-LIST &optional ALLOWS-SYMBOLS SYMBOL-LIST SYMBOL-OFFSET
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
4.2.3 Functions
- Function: cron-dispatcher ()
-
function that dispatches the jobs that are ready to be run
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: elements-within-step LST STEP
-
function that returns a list of elements that are within a step from each other starting with the first element in the list
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: expand-internal-lists LST
-
function that takes a list and returns a list but with all internal lists expanded
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: get-days-of-month UNIT STEP-UNIT
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: get-days-of-week UNIT STEP-UNIT
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: get-hours UNIT STEP-UNIT
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: get-minutes UNIT STEP-UNIT
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: get-months UNIT STEP-UNIT
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: run-job-if-boot KEY JOB
-
runs the cron-job object in a separate thread if it is a boot job
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: run-job-if-time KEY JOB
-
runs the cron-job object in a separate thread if it is its time
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: time-to-run-job JOB
-
checks if it is time to run the current job based on the current time
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Function: time-until-full-minute TIME
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
4.2.4 Generic functions
- Generic Function: job-@boot OBJECT
-
- Generic Function: (setf job-@boot) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-@boot (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-@boot) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
- Generic Function: job-dom OBJECT
-
- Generic Function: (setf job-dom) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-dom (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-dom) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
- Generic Function: job-dow OBJECT
-
- Generic Function: (setf job-dow) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-dow (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-dow) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
- Generic Function: job-func OBJECT
-
- Generic Function: (setf job-func) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-func (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-func) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
- Generic Function: job-hour OBJECT
-
- Generic Function: (setf job-hour) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-hour (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-hour) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
- Generic Function: job-minute OBJECT
-
- Generic Function: (setf job-minute) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-minute (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-minute) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
- Generic Function: job-month OBJECT
-
- Generic Function: (setf job-month) NEW-VALUE OBJECT
-
- Package
cl-cron
- Methods
- Method: job-month (CRON-JOB cron-job)
-
automatically generated reader method
- Source
cl-cron.lisp (file)
- Method: (setf job-month) NEW-VALUE (CRON-JOB cron-job)
-
automatically generated writer method
- Source
cl-cron.lisp (file)
4.2.5 Classes
- Class: cron-job ()
-
- Package
cl-cron
- Source
cl-cron.lisp (file)
- Direct superclasses
standard-object (class)
- Direct methods
-
- Direct slots
- Slot: minute
-
- Initargs
:job-minute
- Initform
:every
- Readers
job-minute (generic function)
- Writers
(setf job-minute) (generic function)
- Slot: hour
-
- Initargs
:job-hour
- Initform
:every
- Readers
job-hour (generic function)
- Writers
(setf job-hour) (generic function)
- Slot: day-of-month
-
- Initargs
:job-dom
- Initform
:every
- Readers
job-dom (generic function)
- Writers
(setf job-dom) (generic function)
- Slot: month
-
- Initargs
:job-month
- Initform
:every
- Readers
job-month (generic function)
- Writers
(setf job-month) (generic function)
- Slot: day-of-week
-
- Initargs
:job-dow
- Initform
:every
- Readers
job-dow (generic function)
- Writers
(setf job-dow) (generic function)
- Slot: at-boot
-
- Initargs
:job-@boot
- Readers
job-@boot (generic function)
- Writers
(setf job-@boot) (generic function)
- Slot: function-symbol
-
- Initargs
:job-func
- Readers
job-func (generic function)
- Writers
(setf job-func) (generic function)
Appendix A Indexes
A.1 Concepts
A.2 Functions
| Index Entry | | Section |
|
( | | |
| (setf job-@boot) : | | Internal generic functions |
| (setf job-@boot) : | | Internal generic functions |
| (setf job-dom) : | | Internal generic functions |
| (setf job-dom) : | | Internal generic functions |
| (setf job-dow) : | | Internal generic functions |
| (setf job-dow) : | | Internal generic functions |
| (setf job-func) : | | Internal generic functions |
| (setf job-func) : | | Internal generic functions |
| (setf job-hour) : | | Internal generic functions |
| (setf job-hour) : | | Internal generic functions |
| (setf job-minute) : | | Internal generic functions |
| (setf job-minute) : | | Internal generic functions |
| (setf job-month) : | | Internal generic functions |
| (setf job-month) : | | Internal generic functions |
|
C | | |
| cron-dispatcher : | | Internal functions |
|
D | | |
| def-cron-get-methods : | | Internal macros |
| delete-cron-job : | | Exported functions |
|
E | | |
| elements-within-step : | | Internal functions |
| expand-internal-lists : | | Internal functions |
|
F | | |
| Function, cron-dispatcher : | | Internal functions |
| Function, delete-cron-job : | | Exported functions |
| Function, elements-within-step : | | Internal functions |
| Function, expand-internal-lists : | | Internal functions |
| Function, gen-list : | | Exported functions |
| Function, get-days-of-month : | | Internal functions |
| Function, get-days-of-week : | | Internal functions |
| Function, get-hours : | | Internal functions |
| Function, get-minutes : | | Internal functions |
| Function, get-months : | | Internal functions |
| Function, log-cron-message : | | Exported functions |
| Function, make-cron-job : | | Exported functions |
| Function, max-list : | | Exported functions |
| Function, min-list : | | Exported functions |
| Function, restart-cron : | | Exported functions |
| Function, run-job-if-boot : | | Internal functions |
| Function, run-job-if-time : | | Internal functions |
| Function, start-cron : | | Exported functions |
| Function, stop-cron : | | Exported functions |
| Function, time-to-run-job : | | Internal functions |
| Function, time-until-full-minute : | | Internal functions |
|
G | | |
| gen-list : | | Exported functions |
| Generic Function, (setf job-@boot) : | | Internal generic functions |
| Generic Function, (setf job-dom) : | | Internal generic functions |
| Generic Function, (setf job-dow) : | | Internal generic functions |
| Generic Function, (setf job-func) : | | Internal generic functions |
| Generic Function, (setf job-hour) : | | Internal generic functions |
| Generic Function, (setf job-minute) : | | Internal generic functions |
| Generic Function, (setf job-month) : | | Internal generic functions |
| Generic Function, job-@boot : | | Internal generic functions |
| Generic Function, job-dom : | | Internal generic functions |
| Generic Function, job-dow : | | Internal generic functions |
| Generic Function, job-func : | | Internal generic functions |
| Generic Function, job-hour : | | Internal generic functions |
| Generic Function, job-minute : | | Internal generic functions |
| Generic Function, job-month : | | Internal generic functions |
| get-days-of-month : | | Internal functions |
| get-days-of-week : | | Internal functions |
| get-hours : | | Internal functions |
| get-minutes : | | Internal functions |
| get-months : | | Internal functions |
|
J | | |
| job-@boot : | | Internal generic functions |
| job-@boot : | | Internal generic functions |
| job-dom : | | Internal generic functions |
| job-dom : | | Internal generic functions |
| job-dow : | | Internal generic functions |
| job-dow : | | Internal generic functions |
| job-func : | | Internal generic functions |
| job-func : | | Internal generic functions |
| job-hour : | | Internal generic functions |
| job-hour : | | Internal generic functions |
| job-minute : | | Internal generic functions |
| job-minute : | | Internal generic functions |
| job-month : | | Internal generic functions |
| job-month : | | Internal generic functions |
|
L | | |
| log-cron-message : | | Exported functions |
|
M | | |
| Macro, def-cron-get-methods : | | Internal macros |
| make-cron-job : | | Exported functions |
| max-list : | | Exported functions |
| Method, (setf job-@boot) : | | Internal generic functions |
| Method, (setf job-dom) : | | Internal generic functions |
| Method, (setf job-dow) : | | Internal generic functions |
| Method, (setf job-func) : | | Internal generic functions |
| Method, (setf job-hour) : | | Internal generic functions |
| Method, (setf job-minute) : | | Internal generic functions |
| Method, (setf job-month) : | | Internal generic functions |
| Method, job-@boot : | | Internal generic functions |
| Method, job-dom : | | Internal generic functions |
| Method, job-dow : | | Internal generic functions |
| Method, job-func : | | Internal generic functions |
| Method, job-hour : | | Internal generic functions |
| Method, job-minute : | | Internal generic functions |
| Method, job-month : | | Internal generic functions |
| min-list : | | Exported functions |
|
R | | |
| restart-cron : | | Exported functions |
| run-job-if-boot : | | Internal functions |
| run-job-if-time : | | Internal functions |
|
S | | |
| start-cron : | | Exported functions |
| stop-cron : | | Exported functions |
|
T | | |
| time-to-run-job : | | Internal functions |
| time-until-full-minute : | | Internal functions |
|
A.3 Variables
| Index Entry | | Section |
|
* | | |
| *cron-dispatcher-processing* : | | Internal special variables |
| *cron-dispatcher-thread* : | | Internal special variables |
| *cron-jobs-hash* : | | Internal special variables |
| *cron-load-file* : | | Exported special variables |
| *cron-log-file* : | | Exported special variables |
| *day-list* : | | Internal special variables |
| *month-list* : | | Internal special variables |
|
A | | |
| at-boot : | | Internal classes |
|
D | | |
| day-of-month : | | Internal classes |
| day-of-week : | | Internal classes |
|
F | | |
| function-symbol : | | Internal classes |
|
H | | |
| hour : | | Internal classes |
|
M | | |
| minute : | | Internal classes |
| month : | | Internal classes |
|
S | | |
| Slot, at-boot : | | Internal classes |
| Slot, day-of-month : | | Internal classes |
| Slot, day-of-week : | | Internal classes |
| Slot, function-symbol : | | Internal classes |
| Slot, hour : | | Internal classes |
| Slot, minute : | | Internal classes |
| Slot, month : | | Internal classes |
| Special Variable, *cron-dispatcher-processing* : | | Internal special variables |
| Special Variable, *cron-dispatcher-thread* : | | Internal special variables |
| Special Variable, *cron-jobs-hash* : | | Internal special variables |
| Special Variable, *cron-load-file* : | | Exported special variables |
| Special Variable, *cron-log-file* : | | Exported special variables |
| Special Variable, *day-list* : | | Internal special variables |
| Special Variable, *month-list* : | | Internal special variables |
|
A.4 Data types