Class SchedulerFireTimesExtensions
- Namespace
- Quartz
- Assembly
- Quartz.dll
What a scheduled trigger fires next: its upcoming fire times, read from the scheduler that holds it.
public static class SchedulerFireTimesExtensions
- Inheritance
-
SchedulerFireTimesExtensions
- Inherited Members
Remarks
An extension rather than an IScheduler member: it reads the trigger and its calendar through
members every scheduler has and computes with TriggerFireTimes, so it works unchanged through
any forwarder. HttpScheduler asks its host instead, in one request, which computes them there.
Methods
GetUpcomingFireTimes(IScheduler, TriggerKey, int, CancellationToken)
The next count fire times of the trigger under triggerKey, in UTC
and earliest first, or null when the scheduler holds no such trigger.
public static ValueTask<List<DateTimeOffset>?> GetUpcomingFireTimes(this IScheduler scheduler, TriggerKey triggerKey, int count, CancellationToken cancellationToken = default)
Parameters
schedulerISchedulerThe scheduler holding the trigger.
triggerKeyTriggerKeyThe trigger whose fire times to compute.
countintHow many fire times to answer at most, from 1 to 100.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
The list starts at the trigger's NextFireTimeUtc, the time the scheduler fires
it next, and advances the trigger's schedule from there: in the trigger's own time zone, skipping what
its calendar excludes, and stopping at its end time. It holds fewer than count times
when the schedule ends sooner, and none for a trigger that does not fire again.
The schedule is the stored one. A paused trigger answers the times it would fire once resumed, before any misfire handling resuming applies.
A simple trigger that measures its interval from completion answers only its next fire time: each run after it starts an interval after the one before it completes, which nothing knows ahead of time, and while a firing runs even that next time is provisional.
On an HttpScheduler this is one request to the host's fire-times route, computed where the
trigger and its calendar are stored. A host older than 4.7 has no such route, and the times are computed
here from the trigger and calendar it answers with.
Exceptions
- ArgumentNullException
schedulerortriggerKeyis null.- ArgumentOutOfRangeException
countis less than 1 or more than 100.- ObjectDoesNotExistException
The calendar the trigger names does not exist.
- ArgumentException
The trigger is not an IOperableTrigger, so its schedule cannot be advanced.