(add-worker! {:keys [worker-name body-fn schedule timeout-ms] :as config})Register and launch a periodic worker.
Required keys: :worker-name (string/keyword, unique) :body-fn (0-arg fn) :timeout-ms (ms) :schedule (seqable absolute times: Instant, ZonedDateTime, Date, or epoch ms)
No-op if a worker with same name exists.
Returns nil.
Register and launch a periodic worker. Required keys: :worker-name (string/keyword, unique) :body-fn (0-arg fn) :timeout-ms (ms) :schedule (seqable absolute times: Instant, ZonedDateTime, Date, or epoch ms) No-op if a worker with same name exists. Returns nil.
(stop-all-workers!)Stops all workers. Returns a map of {worker-name -> true|nil}.
Stops all workers. Returns a map of {worker-name -> true|nil}.
(stop-worker! worker-name)Stops the named worker, interrupting in-flight task(s) if graceful shutdown times out. Returns true if a worker was found (and shutdown initiated), else nil.
Stops the named worker, interrupting in-flight task(s) if graceful shutdown times out. Returns true if a worker was found (and shutdown initiated), else nil.
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 |