ISchedulerInterrupt Method (JobKey, CancellationToken)

Quartz.NET 3.0 API Documentation
Request the cancellation, within this Scheduler instance, of all currently executing instances of the identified IJob.

Namespace:  Quartz
Assembly:  Quartz (in Quartz.dll) Version: 3.0.0
Syntax

C#
Task<bool> Interrupt(
	JobKey jobKey,
	CancellationToken cancellationToken = null
)

Parameters

jobKey
Type: QuartzJobKey

[Missing <param name="jobKey"/> documentation for "M:Quartz.IScheduler.Interrupt(Quartz.JobKey,System.Threading.CancellationToken)"]

cancellationToken (Optional)
Type: System.ThreadingCancellationToken

[Missing <param name="cancellationToken"/> documentation for "M:Quartz.IScheduler.Interrupt(Quartz.JobKey,System.Threading.CancellationToken)"]

Return Value

Type: TaskBoolean
true is at least one instance of the identified job was found and interrupted.
Remarks

If more than one instance of the identified job is currently executing, the cancellation token will be set on each instance. However, there is a limitation that in the case that Interrupt(JobKey, CancellationToken) on one instances throws an exception, all remaining instances (that have not yet been interrupted) will not have their Interrupt(JobKey, CancellationToken) method called.

If you wish to interrupt a specific instance of a job (when more than one is executing) you can do so by calling GetCurrentlyExecutingJobs(CancellationToken) to obtain a handle to the job instance, and then invoke Interrupt(JobKey, CancellationToken) on it yourself.

This method is not cluster aware. That is, it will only interrupt instances of the identified InterruptableJob currently executing in this Scheduler instance, not across the entire cluster.

See Also

Reference