Time-Based Scheduling
Run periodic work.
Running Work on a Schedule
Many systems need periodic work: cleaning temp files nightly, sending a digest email each morning, polling an API every minute. This lesson introduces time-based scheduling in Go using the standard library.
The time Package
Go's time package is the foundation. Key tools:
time.Sleeppauses a goroutinetime.Afterreturns a channel that fires oncetime.Tickerfires repeatedlytime.Timerfires once after a delay
All lessons in this course
- Time-Based Scheduling
- The robfig/cron Library
- Tickers for Intervals
- Graceful Job Shutdown