Solid Queue: priorities
This course follows the priority number that every Solid Queue job row carries. It shows where the number comes from when no job sets one: Rails returns nil and Solid Queue stores 0. It covers static and block-based queue_with_priority, per-call overrides with .set(priority:), and the fixed precedence between them. It covers retries, which keep their priority unless retry_on sets one. It shows how one shared scope orders ready and blocked executions, and why priority never ages. It ends with named tiers for jobs sharing a queue.
What you'll learn
- ✓How Rails's nil priority becomes Solid Queue's DEFAULT_PRIORITY of 0
- ✓Static and block-based queue_with_priority, and how .set(priority:) overrides both
- ✓How retries keep their priority and how retry_on's priority: option changes it
- ✓How the shared ordered scope sorts ready and blocked executions by priority and job_id
- ✓Why priority never ages and how a low-priority job can wait without limit
- ✓How a small set of named priority tiers could organize jobs that share a queue
Priority is a decision, not a default
No job in this app calls queue_with_priority; a search of app/jobs/ for priority finds nothing. Every job still has a priority, because every row in solid_queue_jobs does: db/queue_schema.rb makes the column null: false. This lesson is about where that number comes from when nobody asked for one.
Read the full lesson free →Curriculum
7 lessonsPriority is a decision, not a default
Shows that Rails leaves priority nil and Solid Queue stores 0 when building the job row.
Static vs dynamic priority, and who wins
Compares static and block-based queue_with_priority with .set(priority:), which overrides the class value when present.
Retries inherit priority: unless you say otherwise
Shows that a retry keeps its original priority as a new row unless retry_on passes priority:.
Where priority gets read: a recap with a consequence
Explains the shared ordered scope and why a retry lands behind equal-priority work already waiting.
No aging, no floor: priority never expires
Shows that Solid Queue has no aging, so a low-priority job waits while urgent work keeps arriving.
A priority scheme for this app's jobs
Sketches a small set of named priority tiers and explains why the app keeps everything at 0.
Putting it together: one number, six rules
Reviews the rules for where priority starts, what changes it, and ends with a PriorityDispatcher challenge.