Files
main.tsmain
What you'll learn
- Register ScheduleModule and schedule methods with @Cron, @Interval and @Timeout
- Read a cron pattern and use CronExpression and the options that matter (name, timeZone, waitForCompletion)
- Stop, start, add and delete named tasks at runtime through the SchedulerRegistry
Press Run tests to start the app. Its log appears here.Graded endpoints
A cat to feed
Read 1.1 s later: the timeout opened the shelter, the interval has fed several times, and the cron job has reported at least once (it fires on the second)
Each round fed every cat; the count is on the row
The named interval is deleted through the registry
Read 500 ms after pausing: no round ran in between
A fresh interval registered under the same name
Read 500 ms later: rounds are counting again