Background jobs: get slow work off the request

The request that waits on an email server

A walker confirms a booking. Your handler saves it, then sends a confirmation email, then generates a PDF receipt, then returns 200. The email provider is having a slow morning and takes 4 seconds. Your user stares at a spinner for 4 seconds β€” for work they don't even need to wait for. Worse, that request is holding a connection the whole time; enough slow emails and you run out of them and the whole API stalls.

None of that work belongs on the request path. Confirming the booking is instant; the email and receipt are background jobs β€” things that must happen eventually, not before the response. Push them onto a queue, return 200 immediately, and let a separate worker process grind through them.

The senior framing: Anything the caller doesn't need in the response β€” email, receipts, webhooks, thumbnails β€” belongs on a queue. The web process stays fast and responsive; the workers absorb the slow, flaky, retryable work.