Nucleus .Net Core CMS

IScheduledTask Interface

Namespace: Nucleus.Abstractions
Assembly: Nucleus.Abstractions.dll
Scheduled task class interface.
Scheduled Tasks implement the InvokeAsync method to perform their work. The implementation of InvokeAsync should execute asynchronously (either return a Task object, or if your implementation doesn't use async methods, use Task.Run to call a function then return immediately) so that scheduled tasks can run in parallel. The progress object should be used to report success or failure by calling progress.Report.
CreateDefault ()
Create a default ScheduledTask instance for the IScheduledTask implementation. This function is called by the Task Scheuduler to create a default database record for the task if there are no entries.
Remarks
The interval, interval type, and instance type should be set to reasonable defaults. The implementation may choose whether to enable the task by default or not.
InvokeAsync (RunningTask task, IProgress<ScheduledTaskProgress> progress, CancellationToken cancellationToken)
Execute the scheduled task logic.
Parameters
Name Type
task Nucleus.Abstractions.Models.TaskScheduler.RunningTask
progress System.IProgress<Nucleus.Abstractions.Models.TaskScheduler.ScheduledTaskProgress>
cancellationToken System.Threading.CancellationToken