WaCron constructor
WaCron({})
Creates an instance of WaCron.
onCron
is required and specifies the callback function to be executed on each cron tick.
schedule
is required and specifies the cron schedule.
delayFirstMoment
is optional and defaults to true
. When false
, the first tick runs immediately.
Implementation
WaCron({
required this.onCron,
required this.schedule,
this.delayFirstMoment = true,
}) {
registerTime = DateTime.now().microsecondsSinceEpoch;
}