A higher-level scheduler construct built on top of chime.schedule/chime-at
& clojure.core/agent
.
Remembers actively scheduled jobs, until they finish, or are manually cancelled.
A higher-level scheduler construct built on top of `chime.schedule/chime-at` & `clojure.core/agent`. Remembers actively scheduled jobs, until they finish, or are manually cancelled.
(active-chimes scheduler)
Returns the ids of all the ongoing jobs of this <scheduler>, or nil if there aren't any.
Returns the ids of all the ongoing jobs of this <scheduler>, or nil if there aren't any.
(chiming-agent)
(chiming-agent {:keys [error-handler on-finished]
:or {error-handler c/default-error-handler}})
Returns an agent
dressed up as a scheduler.
Can be configured with an :error-handler (2args - job-id/error), and
:on-finished (1arg - job-id) callback. The state of the agent is
a map from job-id => chime-return, and it will grow/shrink
as jobs are scheduled/un-scheduled (or finished). Use it
as the first argument to all functions in this namespace.
Returns an `agent` dressed up as a scheduler. Can be configured with an :error-handler (2args - job-id/error), and :on-finished (1arg - job-id) callback. The state of the agent is a map from job-id => chime-return, and it will grow/shrink as jobs are scheduled/un-scheduled (or finished). Use it as the first argument to all functions in this namespace.
(next-chime-at scheduler id)
Returns the next ZonedDateTime
object
when the job with <id> will chime.
Returns the next `ZonedDateTime` object when the job with <id> will chime.
(next-chimes-at scheduler)
Returns a map from job-id => ZonedDateTime.
Returns a map from job-id => ZonedDateTime.
(schedule! scheduler id->job)
Given a <scheduler> and map from ids => [job-fn times-fn], registers each job-fn (1-arg - the time) to be run per the outcome of times-fn (no-arg).
Given a <scheduler> and map from ids => [job-fn times-fn], registers each job-fn (1-arg - the time) to be run per the outcome of times-fn (no-arg).
(unschedule! scheduler ids)
(unschedule! scheduler dlay-millis ids)
Given a <scheduler>, gracefully un-schedules (per chime.schedule/shutdown!
)
the jobs referred to by <ids>. Triggers the :on-finished
handler
(see scheduler
ctor).
Given a <scheduler>, gracefully un-schedules (per `chime.schedule/shutdown!`) the jobs referred to by <ids>. Triggers the `:on-finished` handler (see `scheduler` ctor).
(unschedule-now! scheduler ids)
(unschedule-now! scheduler dlay-millis ids)
Like unschedule!
, but uses chime.schedule/shutdown-now!
.
Like `unschedule!`, but uses `chime.schedule/shutdown-now!`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close