An idiomatic Quartz wrapper for Clojure.
An idiomatic Quartz wrapper for Clojure.
(start)Start the Quartz scheduler if not already done so.
Start the Quartz scheduler if not already done so.
(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.
| 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:
(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)) ```
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |