Liking cljdoc? Tell your friends :D

dev.skivi.skivi.core

Unified entry point that wires all skivi components into a single system map.

Typical usage:

(def system (-> (skivi/create-system config {"send-email" handle-send-email}) (skivi/start!)))

(skivi/add-job system "send-email" {:to "x@y.com"})

;; On shutdown (skivi/stop! system)

Unified entry point that wires all skivi components into a single system map.

Typical usage:

  (def system
    (-> (skivi/create-system config {"send-email" handle-send-email})
        (skivi/start!)))

  (skivi/add-job system "send-email" {:to "x@y.com"})

  ;; On shutdown
  (skivi/stop! system)
raw docstring

add-jobclj

(add-job system task-identifier payload)
(add-job system task-identifier payload opts)

Validates payload and enqueues a single job. Returns the created job.

Validates payload and enqueues a single job. Returns the created job.
sourceraw docstring

add-jobsclj

(add-jobs system job-specs)

Validates all payloads and enqueues multiple jobs atomically. Returns created jobs.

Validates all payloads and enqueues multiple jobs atomically. Returns created jobs.
sourceraw docstring

create-systemclj

(create-system config)
(create-system config task-registry)
(create-system config task-registry crontabs)

Creates a system map from config, task-registry, and optional crontabs. Does not start any background processes - call start! to begin processing.

If config contains [:worker :task-directory], Clojure files there are loaded at startup and merged with task-registry. The programmatic task-registry wins on identifier conflicts.

config - validated Config map (see config/load-config) task-registry - map of task-identifier string to handler fn crontabs - vector of CrontabEntry maps (see scheduler/create-scheduler)

Creates a system map from config, task-registry, and optional crontabs.
Does not start any background processes - call start! to begin processing.

If config contains [:worker :task-directory], Clojure files there are loaded
at startup and merged with task-registry. The programmatic task-registry wins
on identifier conflicts.

config        - validated Config map (see config/load-config)
task-registry - map of task-identifier string to handler fn
crontabs      - vector of CrontabEntry maps (see scheduler/create-scheduler)
sourceraw docstring

emitter-statsclj

(emitter-stats system)

Returns a snapshot of monitoring emitter metrics.

Returns a snapshot of monitoring emitter metrics.
sourceraw docstring

force-unlock-jobsclj

(force-unlock-jobs system)
(force-unlock-jobs system worker-ids)

Clears locks on locked jobs. With no worker-ids, unlocks all locked jobs.

Clears locks on locked jobs. With no worker-ids, unlocks all locked jobs.
sourceraw docstring

force-unlock-queuesclj

(force-unlock-queues system)
(force-unlock-queues system queue-names)

Clears locks on named job queues. With no queue-names, unlocks all locked queues.

Clears locks on named job queues. With no queue-names, unlocks all locked queues.
sourceraw docstring

health-checkclj

(health-check system)

Returns true if the database is accessible, false otherwise.

Returns true if the database is accessible, false otherwise.
sourceraw docstring

load-task-registryclj

(load-task-registry task-directory)
(load-task-registry task-directory file-extensions)

Loads task handlers from Clojure files in task-directory. Each file must evaluate to a {"task-id" handler-fn} map as its last expression. file-extensions is a sequence of file suffixes to include (default: [".clj"]). Returns a merged registry map; files are processed in alphabetical order.

Loads task handlers from Clojure files in task-directory.
Each file must evaluate to a {"task-id" handler-fn} map as its last expression.
file-extensions is a sequence of file suffixes to include (default: [".clj"]).
Returns a merged registry map; files are processed in alphabetical order.
sourceraw docstring

maintenance-statsclj

(maintenance-stats system)

Returns a snapshot of maintenance scheduler metrics, or nil if disabled.

Returns a snapshot of maintenance scheduler metrics, or nil if disabled.
sourceraw docstring

permanently-fail-jobsclj

(permanently-fail-jobs system job-ids reason)

Sets jobs to exhausted status with reason as last-error.

Sets jobs to exhausted status with reason as last-error.
sourceraw docstring

query-historyclj

(query-history system criteria)

Returns history records matching criteria map from the database. Criteria keys (all optional): :from, :to, :task-identifier, :status, :limit.

Returns history records matching criteria map from the database.
Criteria keys (all optional): :from, :to, :task-identifier, :status, :limit.
sourceraw docstring

recent-historyclj

(recent-history system)
(recent-history system n)

Returns recent job execution records from the in-memory ring buffer. With n, returns the last n records. No database access.

Returns recent job execution records from the in-memory ring buffer.
With n, returns the last n records. No database access.
sourceraw docstring

register-rate-limitclj

(register-rate-limit system key capacity interval)

Registers or updates a rate limit. capacity is max tokens per interval. interval is a SQL interval string (e.g. "1 minute").

Registers or updates a rate limit. capacity is max tokens per interval.
interval is a SQL interval string (e.g. "1 minute").
sourceraw docstring

replay-failed-jobsclj

(replay-failed-jobs system criteria)

Creates new jobs from failed history records matching criteria map.

Creates new jobs from failed history records matching criteria map.
sourceraw docstring

reschedule-jobsclj

(reschedule-jobs system job-ids opts)

Updates run-at, priority, or max-attempts for job-ids. Returns updated jobs.

Updates run-at, priority, or max-attempts for job-ids. Returns updated jobs.
sourceraw docstring

scheduler-statsclj

(scheduler-stats system)

Returns a snapshot of scheduler operational metrics, or nil if no scheduler.

Returns a snapshot of scheduler operational metrics, or nil if no scheduler.
sourceraw docstring

start!clj

(start! system)
(start! system opts)

Runs pending migrations unless :migrate? is false, then starts the worker pool and scheduler (when present). Returns system.

opts keys: :migrate? (default true)

Runs pending migrations unless :migrate? is false, then starts the worker
pool and scheduler (when present). Returns system.

opts keys: :migrate? (default true)
sourceraw docstring

stop!clj

(stop! system)
(stop! system opts)

Gracefully stops maintenance, scheduler, worker pool, and closes the connection pool. Returns system.

opts keys: :maintenance-timeout-ms (default 5000), :scheduler-timeout-ms (default 5000), :worker-timeout-ms (default 15000)

Gracefully stops maintenance, scheduler, worker pool, and closes the connection pool.
Returns system.

opts keys: :maintenance-timeout-ms (default 5000), :scheduler-timeout-ms (default 5000),
           :worker-timeout-ms (default 15000)
sourceraw docstring

worker-pool-statsclj

(worker-pool-stats system)

Returns a snapshot of worker pool operational metrics.

Returns a snapshot of worker pool operational metrics.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close