Expand description
The database driver: a jobs table, a failed_jobs table, and a
reservation that is safe when several workers race for the same row.
Timestamps are stored as epoch seconds in bigint columns rather than as
timestamptz. rustlavel-db deliberately leaves a timestamp column as text so
precision survives, and a queue compares times far more often than it shows
them: an integer sorts, compares and indexes without anything having to
agree on a text format.
Structs§
- Create
JobProgress Table - Create
Queue Tables - Database
Progress - Progress in a table. The one to use once the worker is its own process.
- Database
Queue - A queue backed by two database tables.
Constants§
- FAILED_
JOBS_ TABLE - JOBS_
TABLE - The conventional table names, matching Laravel’s.
- JOB_
PROGRESS_ TABLE
Functions§
- create_
tables - Create the queue’s two tables.
- define_
failed_ jobs_ table - The dead-letter table.
- define_
job_ progress_ table - Where a job’s progress is kept, so a worker in one process and a request handler in another read the same row.
- define_
jobs_ table - The
jobstable. A free function rather than a closure so a test can build the statements without a database, and see the same schema production gets.