Class ScheduledJobBase
public abstract class ScheduledJobBase : JobBase, IHostedService, IDisposable
- Inheritance
-
ScheduledJobBase
- Implements
- Derived
- Inherited Members
Constructors
ScheduledJobBase(JobParameters, Schedule)
public ScheduledJobBase(JobParameters parameters, Schedule schedule)
Parameters
parametersJobParametersscheduleSchedule
Properties
Schedule
public Schedule Schedule { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
ExecuteAsync(CancellationToken)
This method is called when the IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.
protected override sealed Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationTokenTriggered when StopAsync(CancellationToken) is called.
Returns
Remarks
See Worker Services in .NET for implementation guidelines.
Reschedule(Schedule)
Changes the execution schedule for this job. The new schedule will take effect immediately, but job executions in progress will not halt.
public void Reschedule(Schedule newSchedule)
Parameters
newScheduleSchedule