immutant.jobs documentation

Associate recurring jobs with an application using cron-like and at-style specifications

*job-execution-context*

var

Bound to the currently active org.quartz.JobExecutionContext when a job function is invoked.

internal-scheduler

(internal-scheduler)
Returns the internal Quartz scheduler for use with other libs, e.g. Quartzite

schedule

(schedule name f spec & {:keys [singleton], :or {singleton true}})(schedule name f & {:keys [at in until every repeat singleton], :or {singleton true}})
Schedules a job to execute based on the cron spec or the 'at' options.

Available options [default]:
  :at        Specifies when the 'at' job should start firing. Can be a
             java.util.Date, ms since epoch, or a time in HH:mm
             format (see below). Can't be specified with a cron spec or
             :in [none, now if no cron spec provided]
  :in        Specifies when the 'at' job should start firing, in ms from
             now, a period alias, or a period spec (see below). Can't be 
             specified with a cron spec or :at [none]
  :every     Specifies the delay interval between 'at' job firings, in
             ms, a period alias, or a period spec (see below). If 
             specified without a :repeat or :until, the job will fire
             indefinitely. Can't be specified with a cron spec [none]
  :repeat    Specifies the number of times an 'at' job should repeat
             beyond its initial firing. Can't be specified with a
             spec, and requires :every to be provided [none]
  :until     Specifies when the 'at' job should stop firing. Can be a
             java.util.Date, ms since epoch, or a time in HH:mm format
             (see below). Can't be specified with a cron spec [none]
  :singleton Marks the job as a singleton in a cluster. Singleton
             jobs will only execute on one node. If false, the job will
             execute on every node [true]

As a convenience, you can pass a time as a String (in "HH:mm" or
"HHmm" format) for the :at and :until options. It will be
interpreted as the next occurence of "HH:mm:00" in the currently
active timezone.

You can also pass a period alias or period spec for :in or :repeat. A
period alias is one of: :second, :minute, :hour, :day, :week. A period
spec is a vector or list with a number followed by a period
alias (including plural variants): [1 :second], [5 :minutes]. Each will
be converted into the corresponding milliseconds.

Calling this function with the same name as a previously scheduled job
will replace that job.

set-scheduler-options

(set-scheduler-options options)
Sets defaults for the quartz scheduler(s).
Must be called before any jobs are scheduled.

Available options [default]:
  :thread-count   Specifies the number of worker threads for the scheduler's
                  thread pool [5]

unschedule

(unschedule name)
Removes the named job from the scheduler