Requirements of a task scheduler
medium 26 minA task scheduler runs work later, in the right order, on many machines, and does not forget it.
Where it shows up
The same pattern appears across everyday software.
Video encoding
An upload creates many encoding tasks. They are long and CPU-heavy, so the requirement is progress and restart of a piece, not a fast start.
Ride matching follow-ups
Tasks such as "ask the next driver in 15 seconds" are short and worthless when late. They need a small start latency and a deadline.
Payments and webhooks
Captures, refunds and notifications are retried for days. The requirement is a key for each effect and a complete history.
Campaign email
Millions of messages at the same local time. The requirement is a window, a rate limit for each receiving domain, and the power to cancel.
Nightly reports
Long chains of dependent tasks. The requirement is order inside the chain, a restart from the failed step, and no overlap with tomorrow.
Trial expiry
A task due in 30 days. It must survive thirty days of deployments, so a timer in memory or a message delay of 15 minutes (the limit of SQS) is not enough.