cron method
Run middleware
at a certain interval defined by the cronExpression
.
Implementation
Future<void> cron(String cronExpression, IntervalHandler middleware) async {
var registrationRequest = $sp.RegistrationRequest(
scheduleName: name,
cron: $sp.ScheduleCron(expression: cronExpression),
);
var worker = IntervalWorker(registrationRequest, middleware,
client: _schedulesClient);
await worker.start();
}