GenesisOne / working samples

Node.js + SQLite · source included

A small job queue that survives a restart.

Persistent jobs, worker leases, bounded retries and dead-letter recovery in a dependency-free, single-host reference implementation.

13 tests passed4 real processes raced for 1 jobNode.js 24.19.0 · Windows

How a job moves

Ready→Leased→DoneorRetry→Dead letter

Each claim gets a fresh token. An expired worker cannot acknowledge a job after another worker takes over. A failed job waits before retrying; exhausted jobs can be inspected and explicitly requeued.

Run it locally

Extract the ZIP and run these commands from its folder. No installation, credentials or network access are required.

node --test queue.test.mjs
node example-worker.mjs example.sqlite
node example-worker.mjs example.sqlite

The first example run completes one uppercase-text job. The second reports No due job. The persisted idempotency key prevents it from creating another copy.

What was checked

Where the sample stops

Execution is at least once. A job can repeat an external effect if its worker dies before acknowledgment. The job handler must make those effects idempotent; lease tokens protect queue state only.

There is no heartbeat, hosted worker or production integration. Multiple hosts, network filesystems, crash or power-loss durability, load limits, backups and migration are not validated. See the README for the exact assumptions.