Skip to content

launchql-ext-jobs-queue

Transactional SQL job queues and scheduled jobs for external workers

launchql-ext-jobs-queue · Transactional SQL job queues and scheduled jobs for external workers

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102023launchql-ext-jobs-queuelaunchql-ext-jobs-queue0.4.5FEATMITSQL

Usage

Sources:

launchql-ext-jobs-queue 0.4.5 stores asynchronous jobs transactionally in PostgreSQL. An external worker performs the actual application task.

Core Workflow

Install dependencies and prepare the administrator role before creating the extension. Claim a job as a uniquely named worker, process it, then acknowledge or fail the returned job ID.

CREATE EXTENSION "launchql-ext-jobs-queue" CASCADE;
SELECT app_jobs.add_job('send_email', '{"recipient":"reader@example.com"}'::json);
SELECT * FROM app_jobs.get_job('worker_1');

Objects and Dependencies

app_jobs.jobs and app_jobs.job_queues store work and queue state. app_jobs.complete_job(worker_id, job_id) acknowledges a claimed job; app_jobs.fail_job(worker_id, job_id, error_message) records a failure. app_jobs.add_scheduled_job, app_jobs.get_scheduled_job and app_jobs.run_scheduled_job manage scheduled work. Dependencies are plpgsql, pgcrypto, uuid-ossp and launchql-ext-default-roles.

Boundaries

The current README uses a different example namespace; the installed API is the versioned SQL cited above. Both LaunchQL job extensions create the same app_jobs objects and must not be installed together. No shared library or preload is needed. SQL function installation requires suitable rights in that schema; the control’s non-superuser setting does not grant missing roles or permissions. Workers must handle retries, expired claims and job retention. No PostgreSQL-major support claim is inferred from the SQL language.

Table reader