Solid Queue: job architecture
This course reads the solid_queue 1.3.2 code that moves rows between its eleven tables, and the SQL each move produces. It covers the enqueue transaction and the worker claim with FOR UPDATE SKIP LOCKED and two poll indexes. It also covers concurrency limits as semaphore and blocked rows, plus scheduled, failed and retried jobs. Later lessons cover process heartbeats, orphaned claims, recurring tasks, pauses, and the connection pool check that can stop the supervisor at boot. The last lesson traces one job through every table.
What you'll learn
- ✓The enqueue transaction and why execution rows repeat job columns
- ✓Claiming jobs with FOR UPDATE SKIP LOCKED and the two poll indexes
- ✓Concurrency limits as semaphore rows and blocked execution rows
- ✓Scheduled, failed and retried jobs, and cleanup of finished rows
- ✓Process registration, heartbeats and what happens to orphaned claims
- ✓Recurring tasks, queue pauses and the connection pool validation at boot
Enqueue is one transaction, two tables
The junior course "Solid Queue: background jobs" listed this app's eleven solid_queue_* tables and read config/queue.yml line by line. It stopped at the names. This course reads the code that moves rows between those tables, using solid_queue 1.3.2. It captures the SQL each move produces against…
Read the full lesson free →Curriculum
7 lessonsEnqueue is one transaction, two tables
What perform_later writes: one transaction inserting a job row and a ready execution row copying queue and priority.
The claim: FOR UPDATE SKIP LOCKED and two poll indexes
How a worker claims rows with FOR UPDATE SKIP LOCKED, orders them by priority, and uses two poll indexes.
Concurrency controls: a semaphore row and a blocked row
How limits_concurrency works through a semaphore row, blocked executions, a conflict-safe insert and an expiry duration.
Scheduled, failed and retried: three more tables
How the dispatcher moves scheduled jobs, how failures are recorded, and why retry_on creates a second job row.
Processes, heartbeats and orphaned claims
How processes register and send heartbeats, and how claims left by dead or missing workers become failed executions.
Recurring tasks, pauses, and the pool that refuses to start
Recurring tasks guarded by a unique index, queue pauses, and the pool size check that aborts the supervisor.
Putting it together: one job through eleven tables
One job from this app traced through all eleven tables, with the design decisions and costs they encode.