Scheduler
The scheduler supports fixed intervals, EveryMinute, Hourly, Daily, and five-field cron expressions.
Interval#
Registration excerpt from the upstream README:
scheduler.Default.Hourly("reports", func(ctx context.Context) error {
return nil
})Cron#
scheduler.Default.Cron(
"weekday-report",
"0 8 * * 1-5",
func(ctx context.Context) error {
return nil
},
)These excerpts require the context and github.com/arfajhf/copytygo/v5/scheduler imports. Register them within your application lifecycle. The callbacks above do not implement any business logic yet.
The runtime tracks the next run, last run, run count, and last error. Studio provides a scheduler inspector. Application shutdown cancels the background context and stops workers. Do not assume cross-instance coordination or exactly-once execution without additional implementation.
Versioned sources v5.0.0: README.md · docs/ARCHITECTURE.md · scheduler/scheduler.go.