(add-job system task-identifier payload)(add-job system task-identifier payload opts)Validates payload then adds single job to queue.
Validates payload then adds single job to queue.
(add-jobs system job-specs)Validates all payloads then adds multiple jobs atomically.
Validates all payloads then adds multiple jobs atomically.
(complete-jobs system worker-id jobs execution-time-ms)Marks jobs as completed and updates their history records. jobs must be the enriched maps returned by get-jobs.
Marks jobs as completed and updates their history records. jobs must be the enriched maps returned by get-jobs.
(fail-jobs system worker-id job-errors execution-time-ms)Records job failures: reschedules with exponential backoff and updates history. job-errors is a sequence of {:job job :error throwable-or-string} maps. jobs must be the enriched maps returned by get-jobs.
Records job failures: reschedules with exponential backoff and updates history.
job-errors is a sequence of {:job job :error throwable-or-string} maps.
jobs must be the enriched maps returned by get-jobs.(force-unlock-jobs system)(force-unlock-jobs system worker-ids)Resets locked_by and locked_at on locked jobs. Unlocks affected queues. Optionally restricted to given worker-ids; nil means all locked jobs.
Resets locked_by and locked_at on locked jobs. Unlocks affected queues. Optionally restricted to given worker-ids; nil means all locked jobs.
(force-unlock-queues system)(force-unlock-queues system queue-names)Clears locked_by and locked_at on job queues. Optionally restricted to given queue-names; nil means all locked queues.
Clears locked_by and locked_at on job queues. Optionally restricted to given queue-names; nil means all locked queues.
(gc-job-history system)Removes expired job history records. Returns count of deleted rows.
Removes expired job history records. Returns count of deleted rows.
(gc-job-queues system)Removes empty, unlocked job queues.
Removes empty, unlocked job queues.
(gc-task-identifiers system)(gc-task-identifiers system opts)Removes unused task identifiers. Returns count of deleted rows.
Removes unused task identifiers. Returns count of deleted rows.
(get-jobs system worker-id)(get-jobs system worker-id opts)Retrieves and locks available jobs for worker-id. Generates a correlation-id per job and records job start in history. Returns jobs with schema/correlation-id-key embedded for use with complete-jobs, fail-jobs, and report-partial-success.
Retrieves and locks available jobs for worker-id. Generates a correlation-id per job and records job start in history. Returns jobs with schema/correlation-id-key embedded for use with complete-jobs, fail-jobs, and report-partial-success.
(permanently-fail-jobs system job-ids reason)Sets jobs to exhausted status with reason. Unlocks any queues affected.
Sets jobs to exhausted status with reason. Unlocks any queues affected.
(refill-rate-limits system)Refills tokens for all rate limits whose window has expired.
Refills tokens for all rate limits whose window has expired.
(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").
(replay-failed-jobs system criteria)Creates new jobs from failed history records matching criteria.
Creates new jobs from failed history records matching criteria.
(report-partial-success system worker-id job partial-results execution-time-ms)Records partial success: reschedules job with exponential backoff and records partial_success in history. job must be the enriched map returned by get-jobs. When attempts = max-attempts, routes to permanent exhaustion instead of rescheduling to prevent the job becoming a zombie (rescheduled but never claimable).
Records partial success: reschedules job with exponential backoff and records partial_success in history. job must be the enriched map returned by get-jobs. When attempts = max-attempts, routes to permanent exhaustion instead of rescheduling to prevent the job becoming a zombie (rescheduled but never claimable).
(reschedule-jobs system job-ids opts)Updates run-at, priority, or max-attempts for jobs.
Updates run-at, priority, or max-attempts for jobs.
(reset-locked-jobs system)(reset-locked-jobs system opts)Resets jobs whose locks have exceeded the timeout. Returns count of reset jobs.
Resets jobs whose locks have exceeded the timeout. Returns count of reset jobs.
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 |