WaCron constructor

WaCron({
  1. required Future onCron(
    1. int count,
    2. WaCron cron
    ),
  2. required String schedule,
  3. bool delayFirstMoment = true,
})

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;
}