Scheduled tasks
Asynchronous tasks don't need to be generated directly by a frontend and direct action by a user, but can also be set to run at specific times, through a schedule.
Some examples of scheduled tasks include generating daily reports during night hours, updating information hourly via an external API, precaching values so they are quickly available later, generating a schedule for next week at the start of the week, and sending reminder emails every hour.
Most task queues will allow the generation of scheduled tasks, indicating it clearly in their definition, so they will be triggered automatically.
We will see later in the chapter how to generate a scheduled task for Celery.
Some scheduled tasks can be quite big, such as each night sending emails to thousands of recipients. It's very useful to divide a scheduled task, so a small scheduled task is triggered just to add all the individual tasks to the queue that will be processed later...