Long-running jobs: answer now, finish later
Work that takes longer than a user will hold a request open must leave the request path, and the design that replaces it (a job record, a queue, a worker pool and a way to report status) has a handful of failure modes that decide the grade.
What you'll be able to do
- Recognise work that does not belong on the request path and replace it with an accepted-now, done-later contract
- Size a worker pool from arrival rate and service time, and show how one large batch starves a shared queue
- Make a crashed worker's job retry safely using leases, heartbeats and idempotent steps
- Separate queues by priority and size, and support delay, cancellation and progress reporting
Before this: queues-and-backpressure
Log in to read the rest of this lesson
Work that takes longer than a user will hold a request open must leave the request path, and the design that replaces it (a job record, a queue, a worker pool and a way to report status) has a handful of failure modes that decide the grade. This walkthrough runs about 21 minutes, with runnable code you can edit and re-run as you read. A new account gets 7 days of Pro free, no card required.
Log in to continueThe first module of every track is free to read on the web: see what's open in System design.