Background task scheduling via Quartzite. Individual tasks are defined in metabase.task.*
.
The most appropriate way to initialize tasks in any metabase.task.*
namespace is to implement the task-init
function which accepts zero arguments. This function is dynamically resolved and called exactly once when the
application goes through normal startup procedures. Inside this function you can do any work needed and add your
task to the scheduler as usual via schedule-task!
.
Find the JavaDoc for Quartz here: http://www.quartz-scheduler.org/api/2.3.0/index.html
Background task scheduling via Quartzite. Individual tasks are defined in `metabase.task.*`. ## Regarding Task Initialization: The most appropriate way to initialize tasks in any `metabase.task.*` namespace is to implement the `task-init` function which accepts zero arguments. This function is dynamically resolved and called exactly once when the application goes through normal startup procedures. Inside this function you can do any work needed and add your task to the scheduler as usual via `schedule-task!`. ## Quartz JavaDoc Find the JavaDoc for Quartz here: http://www.quartz-scheduler.org/api/2.3.0/index.html
(add-job! job)
Inputs: [job :- JobDetail]
Add a job separately from a trigger, replace if the job is already there
Inputs: [job :- JobDetail] Add a job separately from a trigger, replace if the job is already there
(add-trigger! trigger)
Inputs: [trigger :- Trigger]
Add a trigger. Assumes the trigger is already associated to a job (i.e. trigger/for-job
)
Inputs: [trigger :- Trigger] Add a trigger. Assumes the trigger is already associated to a job (i.e. `trigger/for-job`)
(delete-task! job-key trigger-key)
Inputs: [job-key :- JobKey trigger-key :- TriggerKey]
delete a task from the scheduler
Inputs: [job-key :- JobKey trigger-key :- TriggerKey] delete a task from the scheduler
(delete-trigger! trigger-key)
Inputs: [trigger-key :- TriggerKey]
Remove trigger-key
from the scheduler
Inputs: [trigger-key :- TriggerKey] Remove `trigger-key` from the scheduler
(init! job-name-string)
Initialize (i.e., schedule) Job(s) with a given name. All implementations of this method are called once and only
once when the Quartz task scheduler is initialized. Task namespaces (metabase.task.*
) should add new
implementations of this method to schedule the jobs they define (i.e., with a call to schedule-task!
.)
The dispatch value for this function can be any unique keyword, but by convention is a namespaced keyword version of the name of the Job being initialized; for sake of consistency with the Job name itself, the keyword should be left CamelCased.
(defmethod task/init! ::SendPulses [_] (task/schedule-task! my-job my-trigger))
Initialize (i.e., schedule) Job(s) with a given name. All implementations of this method are called once and only once when the Quartz task scheduler is initialized. Task namespaces (`metabase.task.*`) should add new implementations of this method to schedule the jobs they define (i.e., with a call to `schedule-task!`.) The dispatch value for this function can be any unique keyword, but by convention is a namespaced keyword version of the name of the Job being initialized; for sake of consistency with the Job name itself, the keyword should be left CamelCased. (defmethod task/init! ::SendPulses [_] (task/schedule-task! my-job my-trigger))
(schedule-task! job trigger)
Inputs: [job :- JobDetail trigger :- Trigger]
Add a given job and trigger to our scheduler.
Inputs: [job :- JobDetail trigger :- Trigger] Add a given job and trigger to our scheduler.
(scheduler-info)
Return raw data about all the scheduler and scheduled tasks (i.e. Jobs and Triggers). Primarily for debugging purposes.
Return raw data about all the scheduler and scheduled tasks (i.e. Jobs and Triggers). Primarily for debugging purposes.
(start-scheduler!)
Start our Quartzite scheduler which allows jobs to be submitted and triggers to begin executing.
Start our Quartzite scheduler which allows jobs to be submitted and triggers to begin executing.
(stop-scheduler!)
Stop our Quartzite scheduler and shutdown any running executions.
Stop our Quartzite scheduler and shutdown any running executions.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close