A customer signs up. Your app must also send a welcome email.
The app calls the email service and waits for it.
The email service is slow today. It takes 3 seconds.
The customer stares at a spinner for the whole 3 seconds.
If the email service is down, the sign-up fails too.
The user gets an answer now; the work happens later.
A line absorbs bursts that would flatten the slow service.
A job may run twice, so doing it twice must be safe.
Reach for it when
When slow work can wait, like sending 10,000 emails after a sale or resizing uploads. Not when the answer is needed now.
The catch
After a crash the line can hand out a job twice, so a customer gets two emails unless repeating is safe.
Say it in an interview“I would put slow, non-urgent work on a queue so the request returns fast and a worker handles it. Workers must be idempotent, because delivery can repeat.”