Liking cljdoc? Tell your friends :D

ablauf.job.sql

A minimalist job queue worker for SQL. This assumes multiple worker off of a main job queue. In the following code, each worker is assumed to be able to process both actions and workflow evaluation. The processing is based off of two tables: task and workflow_run. workflow_run holds information about a full workflow run and its current status, while task is used for both calls to job/restart and action dispatches.

A minimalist job queue worker for SQL. This assumes
multiple worker off of a main job queue. In the following
code, each worker is assumed to be able to process both
actions and workflow evaluation. The processing is based off
of two tables: `task` and `workflow_run`. `workflow_run` holds
information about a full workflow run and its current status,
while `task` is used for both calls to `job/restart` and action
dispatches.
raw docstring

deserializeclj

source

fail-pending-tasks!clj

(fail-pending-tasks! db jobstore)

Sequentially fails all tasks marked as pending. Returns a set with workflow ids. Workflows can then be retried via (retry tx workflow-id jobstore)

Sequentially fails all tasks marked as pending.
Returns a set with workflow ids.
Workflows can then be retried via `(retry tx workflow-id jobstore)`
sourceraw docstring

serializeclj

source

submitclj

(submit
  db
  jobstore
  job
  {:keys [context type system uuid owner metadata]
   :or
     {context {} metadata {} owner "unknown" type "unknown" system "unknown"}})

Create a new job to be processed. Only registers the job entry, no processing will be performed unless at least one separate thread concurrently runs worker.

Create a new job to be processed. Only registers the job entry, no
processing will be performed unless at least one separate thread
concurrently runs `worker`.
sourceraw docstring

submit-retryclj

(submit-retry db jobstore wid)

Retries a given job by its id. If the job is in a replayable state, it will register a job entry for restarting the job. Returns true if the job is retryable, false otherwise. Will throw an exception if the job has not terminated. The processing should be done by a worker thread.

Retries a given job by its id. If the job is in a replayable state, it will register a job entry for restarting the job.
Returns `true` if the job is retryable, `false` otherwise.
Will throw an exception if the job has not terminated.
The processing should be done by a `worker` thread.
sourceraw docstring

workerclj

(worker db jobstore {:keys [action-fn]} wait-ms wait-allowance stop-fn)

Until stop-fn returns true, process items until the queue is exhausted, then wait for a random amount of time (between wait-ms and wait-ms + wait-allowance).

As many worker threads as necessary can be started on a single host.

Until `stop-fn` returns true, process items until the queue is
exhausted, then wait for a random amount of time (between `wait-ms`
and `wait-ms` + `wait-allowance`).

 As many worker threads as necessary can be started on a single
host.
sourceraw docstring

workflow-by-uuidclj

(workflow-by-uuid tx uuid)

Fetch workflow from the database by UUID and restore stored job data to a usable form.

Fetch workflow from the database by UUID and restore stored job data to
a usable form.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close