PRO

Bun SQLite Job Queue

A durable background job queue with BullMQ semantics and no Redis, built on bun:sqlite and the Bun Worker global. Jobs are claimed race-free across threads with a single UPDATE ... RETURNING, so two workers never take the same row; a visibility timeout makes a crashed worker's in-flight job claimable again instead of lost; failures retry with exponential backoff and land in a dead_letters table after a max-attempts budget. The consumer pool is the same file re-imported as a worker through Bun.isMainThread, and WAL mode with a busy_timeout lets N threads share one .db safely. Zero npm dependencies: storage and the pool both ship inside Bun.

Install
npx shadcn@latest add https://ui.aryank.space/r/bun-sqlite-job-queue.json

Installs from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.

Visualization
job
job
Job | null
queue
Database
const job = q.claim(); q.fail(job, err) // retry at 2^attempts

Jobs are claimed race-free with UPDATE ... RETURNING so two workers never take the same row; a failure retries with exponential backoff and eventually completes.

Files

Dependencies
None.