Enum ShutdownJobInterruption
- Namespace
- Quartz
- Assembly
- Quartz.dll
When a shutting-down scheduler signals cancellation to the jobs still executing.
public enum ShutdownJobInterruption
Fields
Always = 3Running jobs are interrupted on every shutdown, whether it waits for them or not.
Never = 0Running jobs are never interrupted. The default.
WhenNotWaitingForJobs = 1Running jobs are interrupted only on a shutdown that does not wait for them.
The shutdown is not going to wait, so the alternative is leaving the jobs running with nothing left to report to.
WhenWaitingForJobs = 2Running jobs are interrupted only on a shutdown that waits for them to finish.
The wait still happens: the jobs are asked to stop and then given as long as they need to, which is how a job that checks its cancellation token gets to unwind cleanly.
Remarks
A shutdown either waits for running jobs to finish or it does not, and interrupting them is a reasonable thing to want in either case — or in only one of them. This says which, in one setting.
Only a job whose execution context implements IInterruptableJobExecutionContext is signalled;
a job that ignores its cancellation token runs to completion whatever this says.