AboutSummaryRefsLogTreeCommitDiffStats
path: root/doc/mcron.texi
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-23 21:50:03 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-03-24 01:18:15 +0100
commitac39c00859f763933fa86d761812f37862e91b78 (patch)
treec5d4b525a488dc03f538256e480c9adafb62e50c /doc/mcron.texi
parentcae2270fd72961adeae77d21d065bfcb64ca7d77 (diff)
downloadmcron-ac39c00859f763933fa86d761812f37862e91b78.tar.gz
mcron-ac39c00859f763933fa86d761812f37862e91b78.tar.bz2
mcron-ac39c00859f763933fa86d761812f37862e91b78.zip
base: Add '<schedule>' record data type
Reifying the notion of a schedule helps reasoning about the code. Passing a schedule as an argument to related procedures allows writing simpler unit tests. * src/mcron/base.scm(<schedule>): New record data type. (make-schedule, schedule-user, set-schedule-user!) (schedule-system, set-schedule-system!) (schedule-current, set-schedule-current!): New procedures. (system-job-list, user-job-list, configuration-source): Replace those global variables with ... (%global-schedule): ... this global <schedule> instance. * src/mcron/base.scm (use-system-job-list, use-user-job-list) (remove-user-jobs, clear-system-jobs, add-job, find-next-jobs) (display-schedule, run-job-loop): Add '#:SCHEDULE' keyword argument. * doc/mcron.texi (The base module): Update documentation.
Diffstat (limited to 'doc/mcron.texi')
-rw-r--r--doc/mcron.texi15
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/mcron.texi b/doc/mcron.texi
index 04f92bd..f408e11 100644
--- a/doc/mcron.texi
+++ b/doc/mcron.texi
@@ -12,6 +12,7 @@
program for running jobs at scheduled times.
Copyright @copyright{} 2003, 2005, 2006, 2012, 2014 Dale Mellor
+Copyright @copyright{} 2018 Mathieu Lirzin
@quotation
Permission is granted to copy, distribute and/or modify this
@@ -1196,7 +1197,9 @@ This procedure causes all the environment modifiers that have been
specified so far to be forgotten.
@end deffn
-@deffn{Scheme procedure} add-job time-proc action displayable configuration-time configuration-user
+@deffn{Scheme procedure} add-job time-proc action displayable @
+ configuration-time configuration-user @
+ [#:schedule @var{%global-schedule}]
This procedure adds a job specification to the list of all jobs to
run. @var{time-proc} should be a procedure taking exactly one argument
which will be a UNIX time. This procedure must compute the next time
@@ -1211,7 +1214,8 @@ computed. Finally, @var{configuration-user} should be the passwd entry
for the user under whose personality the job is to run.
@end deffn
-@deffn{Scheme procedure} run-job-loop . fd-list
+@deffn{Scheme procedure} run-job-loop @var{fd-list} @
+ [#:schedule @var{%global-schedule}]
@cindex file descriptors
@cindex interrupting the mcron loop
This procedure returns only under exceptional circumstances, but
@@ -1225,15 +1229,16 @@ before calling the @code{run-job-loop} procedure again to resume execution of
the mcron base.
@end deffn
-@deffn{Scheme procedure} remove-user-jobs user
-
+@deffn{Scheme procedure} remove-user-jobs user @
+ [#:schedule @var{%global-schedule}]
The argument @var{user} should be a string naming a user (his
login name), or an integer UID, or an object representing the user's passwd
entry. All jobs on the current job list that are scheduled to be run
under this personality are removed from the job list.
@end deffn
-@deffn{Scheme procedure} display-schedule @var{count} [@var{port}]
+@deffn{Scheme procedure} display-schedule @var{count} [@var{port}] @
+ [#:schedule @var{%global-schedule}]
@cindex schedule of jobs
This procedure is used to display a textual list of the next COUNT jobs
to run.