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.
- Laravel: Queues and Horizon: jobs on a queue, a worker to run them, and a dashboard to watch them.
- Symfony: The Messenger Component: one message bus for background jobs and for talking between services.
- WordPress: WP-Cron and the Action Scheduler: what WordPress uses for scheduled tasks, its well-known quirk, and the fix.