Liking cljdoc? Tell your friends :D

com.timezynk.scheduler

An idiomatic Quartz wrapper for Clojure.

An idiomatic Quartz wrapper for Clojure.
raw docstring

startclj

(start)

Start the Quartz scheduler if not already done so.

Start the Quartz scheduler if not already done so.
sourceraw docstring

stopclj

(stop)

If started, stop the scheduler.

If started, stop the scheduler.
sourceraw docstring

with-schedulecljmacro

(with-schedule &
               :name
               <string>
               :second
               <string>
               :minute
               <string>
               :hour
               <string>
               :day
               <string>
               :month
               <string>
               :weekday
               <string>
               :year
               <string>
               ())

Create a new schedule. Parameters are first a set of optional keyworded strings, followed by executable expressions.

Omitting all optional parameters creates an unnamed schedule that runs on the hour.

ParameterDescription
:nameoptional string Schedule name.
:secondoptional string Second(s). Default "0".
:minuteoptional string Minute(s). Default "0".
:houroptional string Hour(s). Default "*".
:dayoptional string Day(s) of the month. Default "*".
:monthoptional string Month(s). Default "*".
:weekdayoptional string Day(s) of the week. Default `"?".
:yearoptional string Year(s). Default "*".
bodyExpressions following parameters. The work to be done.

If :weekday is set to something other than "?", and :day is left as default, :day will be changed to "?" in order to avoid an exception.

Returns

Log output side effect.

Examples

Default schedule, running on the hour:

(with-schedule
  (do-something))

A named schedule running at 02:00 on Sundays:

(with-schedule
  :name    "Schedule Name"
  :hour    "2"
  :weekday "SUN"
  (do-something)
  (do-something-more))
Create a new schedule. Parameters are first a set of optional `keyword`ed strings, followed by executable expressions.

Omitting all optional parameters creates an unnamed schedule that runs on the hour.

 | Parameter    | Description
 | ---          | ---
 | `:name`      | `optional string` Schedule name.
 | `:second`    | `optional string` Second(s). Default `"0"`.
 | `:minute`    | `optional string` Minute(s). Default `"0"`.
 | `:hour`      | `optional string` Hour(s). Default `"*"`.
 | `:day`       | `optional string` Day(s) of the month. Default `"*"`.
 | `:month`     | `optional string` Month(s). Default `"*"`.
 | `:weekday`   | `optional string` Day(s) of the week. Default `"?".
 | `:year`      | `optional string` Year(s). Default `"*"`.
 | `body`       | Expressions following parameters. The work to be done.

 If `:weekday` is set to something other than `"?"`, and `:day` is left as default, `:day` will be changed to `"?"` in order to avoid an exception.

 **Returns**

 Log output side effect.

 **Examples**

 Default schedule, running on the hour:
 ```clojure
 (with-schedule
   (do-something))
 ```
 
 A named schedule running at 02:00 on Sundays:
 ```clojure
 (with-schedule
   :name    "Schedule Name"
   :hour    "2"
   :weekday "SUN"
   (do-something)
   (do-something-more))
 ```
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close