The cl-cron Reference Manual

This is the cl-cron Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:06:50 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-cron

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

Author

Mackram G Raydan

License

GPL

Version

0.1

Dependency

bordeaux-threads (system).

Source

cl-cron.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-cron/cl-cron.asd

Source

cl-cron.asd.

Parent Component

cl-cron (system).

ASDF Systems

cl-cron.


3.1.2 cl-cron/packages.lisp

Source

cl-cron.asd.

Parent Component

cl-cron (system).

Packages

cl-cron.


3.1.3 cl-cron/cl-cron.lisp

Dependency

packages.lisp (file).

Source

cl-cron.asd.

Parent Component

cl-cron (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-cron

Source

packages.lisp.

Nickname

cron

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.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.

Special Variable: *cron-log-file*

a parameter to set the cron file log location.

Package

cl-cron.

Source

cl-cron.lisp.


5.1.2 Ordinary functions

Function: delete-cron-job (cron-key)

deletes the cron job with the corresponding hash key

Package

cl-cron.

Source

cl-cron.lisp.

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.

Function: log-cron-message (message &optional type)

Simply log the message sent with type as well

Package

cl-cron.

Source

cl-cron.lisp.

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.

Function: max-list (lst)

finds the minimum element of a list

Package

cl-cron.

Source

cl-cron.lisp.

Function: min-list (lst)

finds the minimum element of a list

Package

cl-cron.

Source

cl-cron.lisp.

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.

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.

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.


5.2 Internals


5.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.

Special Variable: *cron-dispatcher-thread*

a parameter to that holds the cron-dispatcher thread

Package

cl-cron.

Source

cl-cron.lisp.

Special Variable: *cron-jobs-hash*

contains a hash of all cron-job objects that need to be run

Package

cl-cron.

Source

cl-cron.lisp.

Special Variable: *day-list*
Package

cl-cron.

Source

cl-cron.lisp.

Special Variable: *month-list*
Package

cl-cron.

Source

cl-cron.lisp.


5.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.


5.2.3 Ordinary functions

Function: cron-dispatcher ()

function that dispatches the jobs that are ready to be run

Package

cl-cron.

Source

cl-cron.lisp.

Function: current-time-as-str ()
Package

cl-cron.

Source

cl-cron.lisp.

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.

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.

Function: get-days-of-month (unit step-unit)
Package

cl-cron.

Source

cl-cron.lisp.

Function: get-days-of-week (unit step-unit)
Package

cl-cron.

Source

cl-cron.lisp.

Function: get-hours (unit step-unit)
Package

cl-cron.

Source

cl-cron.lisp.

Function: get-minutes (unit step-unit)
Package

cl-cron.

Source

cl-cron.lisp.

Function: get-months (unit step-unit)
Package

cl-cron.

Source

cl-cron.lisp.

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.

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.

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.

Function: time-until-full-minute (time)
Package

cl-cron.

Source

cl-cron.lisp.


5.2.4 Generic functions

Generic Reader: job-@boot (object)
Package

cl-cron.

Methods
Reader Method: job-@boot ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

at-boot.

Generic Writer: (setf job-@boot) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-@boot) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

at-boot.

Generic Reader: job-dom (object)
Package

cl-cron.

Methods
Reader Method: job-dom ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

day-of-month.

Generic Writer: (setf job-dom) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-dom) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

day-of-month.

Generic Reader: job-dow (object)
Package

cl-cron.

Methods
Reader Method: job-dow ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

day-of-week.

Generic Writer: (setf job-dow) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-dow) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

day-of-week.

Generic Reader: job-func (object)
Package

cl-cron.

Methods
Reader Method: job-func ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

function-symbol.

Generic Writer: (setf job-func) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-func) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

function-symbol.

Generic Reader: job-hour (object)
Package

cl-cron.

Methods
Reader Method: job-hour ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

hour.

Generic Writer: (setf job-hour) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-hour) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

hour.

Generic Reader: job-minute (object)
Package

cl-cron.

Methods
Reader Method: job-minute ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

minute.

Generic Writer: (setf job-minute) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-minute) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

minute.

Generic Reader: job-month (object)
Package

cl-cron.

Methods
Reader Method: job-month ((cron-job cron-job))

automatically generated reader method

Source

cl-cron.lisp.

Target Slot

month.

Generic Writer: (setf job-month) (object)
Package

cl-cron.

Methods
Writer Method: (setf job-month) ((cron-job cron-job))

automatically generated writer method

Source

cl-cron.lisp.

Target Slot

month.


5.2.5 Classes

Class: cron-job
Package

cl-cron.

Source

cl-cron.lisp.

Direct methods
Direct slots
Slot: minute
Initform

:every

Initargs

:job-minute

Readers

job-minute.

Writers

(setf job-minute).

Slot: hour
Initform

:every

Initargs

:job-hour

Readers

job-hour.

Writers

(setf job-hour).

Slot: day-of-month
Initform

:every

Initargs

:job-dom

Readers

job-dom.

Writers

(setf job-dom).

Slot: month
Initform

:every

Initargs

:job-month

Readers

job-month.

Writers

(setf job-month).

Slot: day-of-week
Initform

:every

Initargs

:job-dow

Readers

job-dow.

Writers

(setf job-dow).

Slot: at-boot
Initargs

:job-@boot

Readers

job-@boot.

Writers

(setf job-@boot).

Slot: function-symbol
Initargs

:job-func

Readers

job-func.

Writers

(setf job-func).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   D   E   F   G   J   L   M   R   S   T  
Index Entry  Section

(
(setf job-@boot): Private generic functions
(setf job-@boot): Private generic functions
(setf job-dom): Private generic functions
(setf job-dom): Private generic functions
(setf job-dow): Private generic functions
(setf job-dow): Private generic functions
(setf job-func): Private generic functions
(setf job-func): Private generic functions
(setf job-hour): Private generic functions
(setf job-hour): Private generic functions
(setf job-minute): Private generic functions
(setf job-minute): Private generic functions
(setf job-month): Private generic functions
(setf job-month): Private generic functions

C
cron-dispatcher: Private ordinary functions
current-time-as-str: Private ordinary functions

D
def-cron-get-methods: Private macros
delete-cron-job: Public ordinary functions

E
elements-within-step: Private ordinary functions
expand-internal-lists: Private ordinary functions

F
Function, cron-dispatcher: Private ordinary functions
Function, current-time-as-str: Private ordinary functions
Function, delete-cron-job: Public ordinary functions
Function, elements-within-step: Private ordinary functions
Function, expand-internal-lists: Private ordinary functions
Function, gen-list: Public ordinary functions
Function, get-days-of-month: Private ordinary functions
Function, get-days-of-week: Private ordinary functions
Function, get-hours: Private ordinary functions
Function, get-minutes: Private ordinary functions
Function, get-months: Private ordinary functions
Function, log-cron-message: Public ordinary functions
Function, make-cron-job: Public ordinary functions
Function, max-list: Public ordinary functions
Function, min-list: Public ordinary functions
Function, restart-cron: Public ordinary functions
Function, run-job-if-boot: Private ordinary functions
Function, run-job-if-time: Private ordinary functions
Function, start-cron: Public ordinary functions
Function, stop-cron: Public ordinary functions
Function, time-to-run-job: Private ordinary functions
Function, time-until-full-minute: Private ordinary functions

G
gen-list: Public ordinary functions
Generic Function, (setf job-@boot): Private generic functions
Generic Function, (setf job-dom): Private generic functions
Generic Function, (setf job-dow): Private generic functions
Generic Function, (setf job-func): Private generic functions
Generic Function, (setf job-hour): Private generic functions
Generic Function, (setf job-minute): Private generic functions
Generic Function, (setf job-month): Private generic functions
Generic Function, job-@boot: Private generic functions
Generic Function, job-dom: Private generic functions
Generic Function, job-dow: Private generic functions
Generic Function, job-func: Private generic functions
Generic Function, job-hour: Private generic functions
Generic Function, job-minute: Private generic functions
Generic Function, job-month: Private generic functions
get-days-of-month: Private ordinary functions
get-days-of-week: Private ordinary functions
get-hours: Private ordinary functions
get-minutes: Private ordinary functions
get-months: Private ordinary functions

J
job-@boot: Private generic functions
job-@boot: Private generic functions
job-dom: Private generic functions
job-dom: Private generic functions
job-dow: Private generic functions
job-dow: Private generic functions
job-func: Private generic functions
job-func: Private generic functions
job-hour: Private generic functions
job-hour: Private generic functions
job-minute: Private generic functions
job-minute: Private generic functions
job-month: Private generic functions
job-month: Private generic functions

L
log-cron-message: Public ordinary functions

M
Macro, def-cron-get-methods: Private macros
make-cron-job: Public ordinary functions
max-list: Public ordinary functions
Method, (setf job-@boot): Private generic functions
Method, (setf job-dom): Private generic functions
Method, (setf job-dow): Private generic functions
Method, (setf job-func): Private generic functions
Method, (setf job-hour): Private generic functions
Method, (setf job-minute): Private generic functions
Method, (setf job-month): Private generic functions
Method, job-@boot: Private generic functions
Method, job-dom: Private generic functions
Method, job-dow: Private generic functions
Method, job-func: Private generic functions
Method, job-hour: Private generic functions
Method, job-minute: Private generic functions
Method, job-month: Private generic functions
min-list: Public ordinary functions

R
restart-cron: Public ordinary functions
run-job-if-boot: Private ordinary functions
run-job-if-time: Private ordinary functions

S
start-cron: Public ordinary functions
stop-cron: Public ordinary functions

T
time-to-run-job: Private ordinary functions
time-until-full-minute: Private ordinary functions