Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shipping Background Work

Send the confirmation email later. Resize the uploaded image later. Generate the monthly report at 2 a.m. with nobody watching. Anything that should not block the user’s request, or that runs on a schedule rather than in response to one, is background work. Doing it well means a queue and a worker process, not a sleep() call and hope.

A restaurant in cross-section. At the front counter, a small elephant hands a person a receipt at once. In the kitchen behind, a rail of order tickets and two elephants in chef hats working through them one by one