Liking cljdoc? Tell your friends :D

dev.skivi.queue.core

In-process job buffer with background polling from job-manager.

Jobs are claimed from the database in batches and held in a LinkedBlockingQueue until a worker calls take-job!. The poll loop runs as a daemon thread and automatically refetches when the buffer depth drops below the configured threshold.

In-process job buffer with background polling from job-manager.

Jobs are claimed from the database in batches and held in a
LinkedBlockingQueue until a worker calls take-job!. The poll loop runs
as a daemon thread and automatically refetches when the buffer depth
drops below the configured threshold.
raw docstring

create-queueclj

(create-queue job-system worker-id)
(create-queue job-system worker-id config)

Creates a local queue. Call start! to begin polling. worker-id is used for all job claims from this queue.

Creates a local queue. Call start! to begin polling.
worker-id is used for all job claims from this queue.
sourceraw docstring

depthclj

(depth queue)

Returns the number of jobs currently buffered locally.

Returns the number of jobs currently buffered locally.
sourceraw docstring

offer-jobs!clj

(offer-jobs! queue jobs)

Places jobs directly into the buffer without claiming them from the database. Useful for re-dispatch or testing.

Places jobs directly into the buffer without claiming them from the database.
Useful for re-dispatch or testing.
sourceraw docstring

running?clj

(running? queue)

Returns true if the background polling loop is active.

Returns true if the background polling loop is active.
sourceraw docstring

start!clj

(start! queue)

Starts the background polling loop. Throws if already running.

Starts the background polling loop. Throws if already running.
sourceraw docstring

statsclj

(stats queue)

Returns a snapshot of queue operational metrics.

Returns a snapshot of queue operational metrics.
sourceraw docstring

stop!clj

(stop! queue)
(stop! queue join-timeout-ms)

Stops polling, waits for the thread, and drains the buffer. Returns a vector of jobs that were buffered but not dispatched.

Stops polling, waits for the thread, and drains the buffer.
Returns a vector of jobs that were buffered but not dispatched.
sourceraw docstring

take-job!clj

(take-job! queue timeout-ms)

Blocks until a job is available or timeout-ms elapses. Entries older than config :ttl-ms are discarded silently. Returns the job map or nil on timeout.

Blocks until a job is available or timeout-ms elapses.
Entries older than config :ttl-ms are discarded silently.
Returns the job map or nil on timeout.
sourceraw docstring

worker-idclj

(worker-id queue)

Returns the worker-id used for database job locking.

Returns the worker-id used for database job locking.
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