cl-cron

2023年10月21日

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

cl-cron

A simple tool that provides cron like facilities directly inside of common lisp.

a fork of https://bitbucket.org/mackram/cl-cron (unavailable)

Install with Quicklisp:

(ql:quickload "cl-cron")

Note: Quicklisp points to this repository since the release of October, 2021.

Example:

Print a message every minute.

(defunsay-hi()(print"Hi!"))
(cl-cron:make-cron-job#'say-hi)(cl-cron:start-cron)

Wait a minute to see output.

Stop all jobs with stop-cron.

API

(make-cron-job function-symbol &key (minute:every)(step-min1)(hour:every)(step-hour1)(day-of-month:every)
(delete-cron-job cron-key)
(time-to-run-job job)
start-cron
restart-cron
stop-cron

Example:

(cl-cron:make-cron-job(lambda()(formatt"Wake Up!~%"))
;; Days of week are numbered from 0,;; where 0 is Monday.;; Run every Sunday::day-of-week6:hour10:minute0;; hash-key is the name:hash-key:sunday-alarm)
(cl-cron:delete-cron-job:sunday-alarm)

https://40ants.com/lisp-project-of-the-day/2020/06/0087-cl-cron.html

Changelog

  • 2020年10月13日: we added a name to the cl-cron thread.

Licence: GPL

Dependencies (1)

Dependents (1)

AltStyle によって変換されたページ (->オリジナル) /