Class HttpScheduler
- Namespace
- Quartz
- Assembly
- Quartz.HttpClient.dll
An IScheduler that reaches a scheduler in another process through the Quartz HTTP API.
public sealed class HttpScheduler : IScheduler, IAsyncDisposable
- Inheritance
-
HttpScheduler
- Implements
- Inherited Members
- Extension Methods
Remarks
Everything is a round trip: this type holds no scheduler state of its own, and every member calls
the endpoint that answers it. Construct one with the remote scheduler's name and an
HttpClient whose BaseAddress is where
MapQuartzHttpApi is mapped, or register it with AddQuartzHttpClient.
What the server rejects arrives as the exception it named: SchedulerException and its
subclasses come back as themselves, and anything else — a request the endpoint refused before it
reached a scheduler, or a server that is not this API — as HttpClientException, which
derives from SchedulerException so one catch covers both.
Two members cannot be honoured over a wire and raise NotSupportedException rather than pretending: Context and ListenerManager, each of which explains itself. Both are physical limits rather than missing routes. DisposeAsync() pointedly does not shut the remote scheduler down — see its own remarks.
Constructors
HttpScheduler(string, HttpClient, JsonSerializerOptions?, SystemTextJsonSerializerRegistry?)
public HttpScheduler(string schedulerName, HttpClient httpClient, JsonSerializerOptions? jsonSerializerOptions = null, SystemTextJsonSerializerRegistry? serializerRegistry = null)
Parameters
schedulerNamestringName of the scheduler, must be same as the remote scheduler.
httpClientHttpClientThe client to call the remote scheduler with.
jsonSerializerOptionsJsonSerializerOptionsOptional serializer options. A copy is taken and Quartz's own converters are added to the copy, so the instance passed in is left untouched.
serializerRegistrySystemTextJsonSerializerRegistryThe trigger and calendar serializers to understand. Custom types are only readable over HTTP when their serializers are given here — the remote scheduler's own registrations are not visible in this process. Defaults to the built-in types.
Properties
Context
Not supported. The context belongs to the scheduler's own process: it is a live, writable object there, and a snapshot fetched over HTTP would be neither.
public SchedulerContext Context { get; }
Property Value
Exceptions
- NotSupportedException
Always.
ListenerManager
Not supported. Listeners run where the jobs run, which is the scheduler's process rather than this one.
public IListenerManager ListenerManager { get; }
Property Value
Exceptions
- NotSupportedException
Always.
SchedulerInstanceId
Returns the instance Id of the IScheduler.
public string SchedulerInstanceId { get; }
Property Value
Remarks
One round trip, and a blocking one: IScheduler declares this a property, and a property cannot be awaited. Prefer GetSchedulerInstanceId(CancellationToken), which asks the same question in the same one request without holding a thread while it is answered, or GetMetadata(CancellationToken) where the whole of the scheduler's details is wanted.
SchedulerName
Returns the name of the IScheduler.
public string SchedulerName { get; }
Property Value
Remarks
The name this client was constructed with, which every request is addressed to. It is not read back from the server, so a name no scheduler goes by is reported when a member is called rather than here.
Status
The remote scheduler's lifecycle state, read over the network.
public SchedulerStatus Status { get; }
Property Value
Remarks
One round trip, where the three booleans this replaces were three - each asking the same endpoint the same question and reading a different field of the answer. A blocking round trip, though: prefer GetStatus(CancellationToken), which asks the same question without holding a thread while it is answered.
TimeProvider
The system clock, which is the only honest answer a proxy can give.
public TimeProvider TimeProvider { get; }
Property Value
Remarks
The clock that decides when a trigger fires is the remote scheduler's, and this process cannot
read it: the HTTP API reports times, not a TimeProvider, and a
TimeProvider is not something that can be fetched over a wire. So a client
building a trigger for a remote scheduler measures "now" against its own clock, exactly as it
would have done writing DateTimeOffset.UtcNow by hand — the two machines agreeing about
the time is the assumption the whole wire format already makes.
Methods
AddCalendar(string, ICalendar, AddCalendarOptions, CancellationToken)
Add (register) the given ICalendar to the Scheduler.
public ValueTask AddCalendar(string calendarName, ICalendar calendar, AddCalendarOptions options = default, CancellationToken cancellationToken = default)
Parameters
calendarNamestringName of the calendar.
calendarICalendarThe calendar.
optionsAddCalendarOptionsWhether an already registered calendar of the same name may be over-written, and whether the triggers that reference it have their next fire time re-computed. Defaults to neither.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- ArgumentNullException
calendarNameorcalendaris null.- SchedulerException
The scheduler has been shut down.
- ObjectAlreadyExistsException
A calendar is already registered under the same name and Replace was not asked for.
AddJob(IJobDetail, AddJobOptions, CancellationToken)
Add the given IJob to the Scheduler - with no associated ITrigger. The IJob will be 'dormant' until it is scheduled with a ITrigger, or TriggerJob(JobKey, JobDataMap?, CancellationToken) is called for it.
public ValueTask AddJob(IJobDetail jobDetail, AddJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
jobDetailIJobDetailThe job to store.
optionsAddJobOptionsWhether an already stored job of the same key may be over-written, and whether a non-durable job may be stored while it awaits a trigger. Defaults to neither.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
The IJob must by definition be 'durable', unless StoreNonDurableWhileAwaitingScheduling is set; if it is neither, a SchedulerException is thrown.
Exceptions
- ArgumentNullException
jobDetailis null.- SchedulerException
The scheduler has been shut down; or the job is not durable and StoreNonDurableWhileAwaitingScheduling was not asked for.
- ObjectAlreadyExistsException
A job is already stored under the same key and Replace was not asked for.
Clear(CancellationToken)
public ValueTask Clear(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
DeleteCalendar(string, CancellationToken)
Delete the identified ICalendar from the Scheduler.
public ValueTask<bool> DeleteCalendar(string calendarName, CancellationToken cancellationToken = default)
Parameters
calendarNamestringName of the calendar.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
If removal of the
Calendar
would result in ITriggers pointing to non-existent calendars, then a SchedulerException will be thrown.
Exceptions
- ArgumentNullException
calendarNameis null.- SchedulerException
The scheduler has been shut down.
- JobPersistenceException
A trigger still references the calendar, so removing it would leave that trigger pointing at nothing.
DeleteJob(JobKey, CancellationToken)
public ValueTask<bool> DeleteJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
Exceptions
- ArgumentNullException
jobKeyis null.- SchedulerException
The scheduler has been shut down.
DeleteJobs(GroupMatcher<JobKey>, CancellationToken)
Delete every IJobDetail in the matching groups from the Scheduler - and any associated ITriggers.
public ValueTask<List<JobKey>> DeleteJobs(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<JobKey>Selects the job groups to empty. Required — there is no "delete the default group" reading of null worth risking on a destructive call.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
The group is the correlation axis: everything belonging to one tenant, one saga or one import shares a job group, and this is how the whole of it goes in one call rather than one round trip per key — and without first listing the keys, which is a window in which another node can add one more.
Unlike PauseJobGroups(GroupMatcher<JobKey>, CancellationToken), nothing is remembered about the groups: a delete has no state to impose on a job added afterwards.
One JobDeleted(IScheduler, JobKey, CancellationToken) is raised per deleted key, and the scheduling change is signalled once for the whole call. A matcher that matched nothing raises nothing.
Exceptions
- ArgumentNullException
matcheris null.- SchedulerException
The scheduler has been shut down.
- See Also
DeleteJobs(IReadOnlyCollection<JobKey>, CancellationToken)
Delete the identified jobs from the Scheduler - and any associated ITriggers.
public ValueTask<List<JobKey>> DeleteJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<JobKey>>
The keys this call deleted, in the order they were given. A key that names no job is simply absent, never a throw —
result.Count == jobKeys.Countis the "every key was found" answer, and the list itself says which ones when it is not.
Remarks
Note that while this bulk operation is likely more efficient than invoking DeleteJob(JobKey, CancellationToken) several times, it may have the adverse affect of holding data locks for a single long duration of time (rather than lots of small durations of time).
One JobDeleted(IScheduler, JobKey, CancellationToken) is raised per key the deletion applied to, and the scheduling change is signalled once for the whole call. A key that was not found raises nothing, as the single-key form raises nothing when it answers false.
Exceptions
- ArgumentNullException
jobKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
DisposeAsync()
Releases what this client owns, which is nothing — and in particular does not shut the remote scheduler down.
public ValueTask DisposeAsync()
Returns
Remarks
Disposing an IScheduler releases what that instance owns. A local scheduler owns the execution it drives, so disposing it stops it. This one owns only a connection to a scheduler running somewhere else, which other clients are using and which outlives this process: a client going away is not an instruction to stop scheduling for everybody. Call Shutdown(bool, CancellationToken) to stop the remote scheduler, deliberately.
The HttpClient is not disposed either — it belongs to whoever made it, an IHttpClientFactory or the caller, and disposing something handed in is how a client shared with the rest of an application stops working.
Exists(JobKey, CancellationToken)
Determine whether a IJob with the given identifier already exists within the scheduler.
public ValueTask<bool> Exists(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeythe identifier to check for
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
Exists(TriggerKey, CancellationToken)
Determine whether a ITrigger with the given identifier already exists within the scheduler.
public ValueTask<bool> Exists(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeythe identifier to check for
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
Exists(string, CancellationToken)
Determine whether an ICalendar with the given name already exists within the scheduler.
public ValueTask<bool> Exists(string calendarName, CancellationToken cancellationToken = default)
Parameters
calendarNamestringthe name to check for
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
Asks the store for the name alone. GetCalendar(string, CancellationToken) answers the same question, but only by loading and deserializing the calendar — an exclusion set that can run to thousands of dates — to throw it away again.
Exceptions
- SchedulerException
The scheduler has been shut down.
GetCalendar(string, CancellationToken)
Get the ICalendar instance with the given name.
public ValueTask<ICalendar?> GetCalendar(string calendarName, CancellationToken cancellationToken = default)
Parameters
calendarNamestringcancellationTokenCancellationToken
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
GetExecutionLimits(CancellationToken)
Gets the currently configured execution group limits, or null if none are configured.
public ValueTask<ExecutionLimits?> GetExecutionLimits(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- ValueTask<ExecutionLimits>
A snapshot of the current execution limits, or null.
GetJobDetail(JobKey, CancellationToken)
Get the IJobDetail for the IJob instance with the given key .
public ValueTask<IJobDetail?> GetJobDetail(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
Remarks
The returned JobDetail object will be a snapshot of the actual stored JobDetail. If you wish to modify the JobDetail, you must re-store the JobDetail afterward (e.g. see AddJob(IJobDetail, AddJobOptions, CancellationToken)).
Exceptions
- SchedulerException
The scheduler has been shut down.
GetJobDetails(IReadOnlyCollection<JobKey>, CancellationToken)
Retrieves the given jobs in one round trip. Keys that do not exist are simply absent from the result.
public ValueTask<List<IJobDetail>> GetJobDetails(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>The keys of the jobs to retrieve.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
GetMetadata(CancellationToken)
Get a SchedulerMetadata object describing the settings and capabilities of the scheduler instance.
public ValueTask<SchedulerMetadata> GetMetadata(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
Note that the data returned is an 'instantaneous' snap-shot, and that as soon as it's returned, the metadata values may be different.
GetSchedulerInstanceId(CancellationToken)
The remote scheduler's instance Id, read over the network without blocking the calling thread.
public ValueTask<string> GetSchedulerInstanceId(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
One round trip, the same one SchedulerInstanceId makes and the same one GetMetadata(CancellationToken) makes. This is the member to call from a request path.
GetStatus(CancellationToken)
The remote scheduler's lifecycle state, read over the network without blocking the calling thread.
public ValueTask<SchedulerStatus> GetStatus(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
One round trip, the same one Status makes. This is the member to call from a request path.
GetTrigger(TriggerKey, CancellationToken)
Get the ITrigger instance with the given key.
public ValueTask<ITrigger?> GetTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
Remarks
The returned Trigger object will be a snap-shot of the actual stored trigger. If you wish to modify the trigger, you must re-store the trigger afterward (e.g. see RescheduleJob(TriggerKey, ITrigger, CancellationToken)).
Exceptions
- SchedulerException
The scheduler has been shut down.
GetTriggerState(TriggerKey, CancellationToken)
Get the current state of the identified ITrigger.
public ValueTask<TriggerState> GetTriggerState(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
- See Also
GetTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
Retrieves the given triggers in one round trip. Keys that do not exist are simply absent from the result.
public ValueTask<List<ITrigger>> GetTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>The keys of the triggers to retrieve.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
The returned triggers are snapshots of the stored ones. If you wish to modify a trigger, you must re-store it afterward (e.g. see RescheduleJob(TriggerKey, ITrigger, CancellationToken)).
Exceptions
- SchedulerException
The scheduler has been shut down.
Interrupt(JobKey, CancellationToken)
Request the cancellation, within this Scheduler instance, of all currently executing instances of the identified IJob.
public ValueTask<bool> Interrupt(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
Remarks
Interruption is cooperative. What the scheduler does is cancel the token the firing was given — CancellationToken, which is the same token Execute(IJobExecutionContext, CancellationToken) receives — so a job that never observes it runs to completion.
If more than one instance of the identified job is currently executing, the token is cancelled on each of them in turn. Cancelling runs whatever the running job registered on its token, so if one of those throws, the instances not yet reached keep running.
To interrupt one specific execution when several of the job are running, list them with QueryFireInstances(FireInstanceQuery, CancellationToken) and pass the one you mean to InterruptFireInstance(string, CancellationToken).
This method is not cluster aware. That is, it will only interrupt instances of the identified job currently executing in this scheduler instance, not across the entire cluster.
Exceptions
- ArgumentNullException
jobKeyis null.- OperationCanceledException
cancellationTokenwas cancelled part-way through, which leaves the firings already reached interrupted.
- See Also
InterruptFireInstance(string, CancellationToken)
Request the cancellation, within this Scheduler instance, of the identified executing job instance.
public ValueTask<bool> InterruptFireInstance(string fireInstanceId, CancellationToken cancellationToken = default)
Parameters
fireInstanceIdstringthe unique identifier of the job instance to be interrupted (see FireInstanceId)
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
Interruption is cooperative, as it is for Interrupt(JobKey, CancellationToken): the firing's CancellationToken is cancelled, and a job that never observes it runs to completion.
This method is not cluster aware. That is, it will only interrupt an instance currently executing in this scheduler instance, not across the entire cluster.
Exceptions
- ArgumentNullException
fireInstanceIdis null.- OperationCanceledException
cancellationTokenwas cancelled.
- See Also
PauseAll(CancellationToken)
Pause all triggers - similar to calling PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) on every group, however, after using this method ResumeAll(CancellationToken) must be called to clear the scheduler's state of 'remembering' that all new triggers will be paused as they are added.
public ValueTask PauseAll(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
When ResumeAll(CancellationToken) is called (to un-pause), trigger misfire instructions WILL be applied.
Exceptions
- SchedulerException
The scheduler has been shut down.
- See Also
PauseJob(JobKey, CancellationToken)
Pause the IJobDetail with the given key - by pausing all of its current ITriggers.
public ValueTask<bool> PauseJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
- ValueTask<bool>
true if the job exists — including a job that currently has no triggers — false if there is no job with the given key. No listener events are raised when nothing was found.
Exceptions
- ArgumentNullException
jobKeyis null.- SchedulerException
The scheduler has been shut down.
PauseJobGroups(GroupMatcher<JobKey>, CancellationToken)
Pause the job groups that match - by pausing all of the ITriggers of the IJobDetails in them.
public ValueTask<List<string>> PauseJobGroups(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<JobKey>cancellationTokenCancellationToken
Returns
Remarks
A group, not a set of jobs, which is why this is named for groups and answers with their
names where PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken) answers
with keys. The pause is recorded against the group itself and outlives the jobs that were in
it when the call was made: it survives a restart, reaches every node of a cluster, is what
IsJobGroupPaused reports, and is imposed on jobs added to the group afterwards. No
list of keys can say that, and an equality matcher pauses a group that holds no job at all —
which is how a caller pauses what is about to be added to it.
The Scheduler will "remember" that the groups are paused, and impose the pause on any new jobs that are added to any of those groups until it is resumed.
NOTE: There is a limitation that only exactly matched groups can be remembered as paused. For example, if there are pre-existing job in groups "aaa" and "bbb" and a matcher is given to pause groups that start with "a" then the group "aaa" will be remembered as paused and any subsequently added jobs in group "aaa" will be paused, however if a job is added to group "axx" it will not be paused, as "axx" wasn't known at the time the "group starts with a" matcher was applied. HOWEVER, if there are pre-existing groups "aaa" and "bbb" and a matcher is given to pause the group "axx" (with a group equals matcher) then no jobs will be paused, but it will be remembered that group "axx" is paused and later when a job is added in that group, it will become paused.
Exceptions
- ArgumentNullException
matcheris null.- SchedulerException
The scheduler has been shut down.
- See Also
PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken)
Pause the IJobDetails with the given keys - by pausing all of their current ITriggers.
public ValueTask<List<JobKey>> PauseJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<JobKey>>
The keys this call found, in the order they were given — a job with no triggers is found and so is present. A key that names no job is simply absent, never a throw.
Remarks
One JobPaused(IScheduler, JobKey, CancellationToken) is raised per key the pause applied to, and the scheduling change is signalled once for the whole call. A key that was not found raises nothing, as the single-key form raises nothing when it answers false.
Exceptions
- ArgumentNullException
jobKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
PauseTrigger(TriggerKey, CancellationToken)
Pause the ITrigger with the given key.
public ValueTask<bool> PauseTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
- ValueTask<bool>
true if the trigger exists and was moved into the paused state by this call, false if there is no trigger with the given key, it was already paused, or it is in a state that cannot be paused (e.g. complete). No listener events are raised when nothing changed.
Exceptions
- ArgumentNullException
triggerKeyis null.- SchedulerException
The scheduler has been shut down.
PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken)
Pause the trigger groups that match, and every ITrigger in them.
public ValueTask<List<string>> PauseTriggerGroups(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<TriggerKey>cancellationTokenCancellationToken
Returns
Remarks
A group, not a set of triggers, which is why this is named for groups and answers with their
names where PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
answers with keys. The pause is recorded against the group itself and outlives the triggers
that were in it when the call was made: it survives a restart, reaches every node of a
cluster, is what IsTriggerGroupPaused reports, and is imposed on triggers stored into
the group afterwards. No list of keys can say that, and an equality matcher pauses a group
that holds no trigger at all — which is how a caller pauses what is about to be added to it.
The Scheduler will "remember" all the groups paused, and impose the pause on any new triggers that are added to any of those groups until it is resumed.
NOTE: There is a limitation that only exactly matched groups can be remembered as paused. For example, if there are pre-existing triggers in groups "aaa" and "bbb" and a matcher is given to pause groups that start with "a" then the group "aaa" will be remembered as paused and any subsequently added triggers in that group be paused, however if a trigger is added to group "axx" it will not be paused, as "axx" wasn't known at the time the "group starts with a" matcher was applied. HOWEVER, if there are pre-existing groups "aaa" and "bbb" and a matcher is given to pause the group "axx" (with a group equals matcher) then no triggers will be paused, but it will be remembered that group "axx" is paused and later when a trigger is added in that group, it will become paused.
Exceptions
- ArgumentNullException
matcheris null.- SchedulerException
The scheduler has been shut down.
- See Also
PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
Pause the ITriggers with the given keys.
public ValueTask<List<TriggerKey>> PauseTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<TriggerKey>>
The keys this call moved into the paused state, in the order they were given. A key that names no trigger, one that was already paused, and one in a state that cannot be paused are each simply absent, never a throw.
Remarks
One TriggerPaused(IScheduler, TriggerKey, CancellationToken) is raised per key the pause applied to, and the scheduling change is signalled once for the whole call. A key that did not move raises nothing, as the single-key form raises nothing when it answers false.
Exceptions
- ArgumentNullException
triggerKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
QueryCalendarNames(CalendarQuery, CancellationToken)
Lists calendar names matching the query, ordered by name (ordinal).
public ValueTask<PagedResult<string>> QueryCalendarNames(CalendarQuery query, CancellationToken cancellationToken = default)
Parameters
queryCalendarQueryWhich names to select and which page of them to return.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
QueryClusterNodes(CancellationToken)
Lists the scheduler nodes the job store knows about, as ClusterNodes — this node first, then the rest by instance id.
public ValueTask<List<ClusterNode>> QueryClusterNodes(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
This node is always listed, and is the only one whose IsCurrentNode is true; its InstanceId is SchedulerInstanceId. A scheduler that is not clustered — the in-memory store, or a persistent one with clustering switched off — answers with that single node and no check-in times, which is the truthful answer rather than an empty list.
The states are what this node believes, read off its own clock against the check-in stamps the other nodes wrote, and they are decided by the same predicate cluster recovery applies. A node reported Failed has its in-flight work taken over on the next check-in pass, after which it stops being listed.
The result is an 'instantaneous' snapshot: by the time it is returned a node may have checked in or been swept away. Join it with QueryFireInstances(FireInstanceQuery, CancellationToken) on SchedulerInstanceId to see what each node is running.
Exceptions
- SchedulerException
The scheduler has been shut down.
- See Also
QueryFireInstances(FireInstanceQuery, CancellationToken)
Lists the firings the scheduler knows about — by default the ones that are running — as FireInstances.
public ValueTask<PagedResult<FireInstance>> QueryFireInstances(FireInstanceQuery query, CancellationToken cancellationToken = default)
Parameters
queryFireInstanceQueryWhat to select and which page of it to return.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
With a persistent job store this sees the whole cluster, not just this node, because a firing is a durable record rather than process-local state. Filter by SchedulerInstanceId to ask about one node — SchedulerInstanceId for this one.
The result is an 'instantaneous' snapshot: by the time it is returned, firings may have started or finished.
A firing an ITriggerListener vetoes does not linger here: applying the veto completes the firing, which removes it. It can be listed for the instant between the store recording the firing and the veto being decided, and never after.
Exceptions
- SchedulerException
The scheduler has been shut down.
- See Also
QueryJobGroups(JobGroupQuery, CancellationToken)
Lists job groups matching the query, ordered by name (ordinal).
public ValueTask<PagedResult<JobGroup>> QueryJobGroups(JobGroupQuery query, CancellationToken cancellationToken = default)
Parameters
queryJobGroupQueryWhat to select and which page of it to return.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
QueryJobs(JobQuery, CancellationToken)
Lists jobs matching the query, as JobHeaders, ordered by group and then name (ordinal). Listing never loads job data.
public ValueTask<PagedResult<JobHeader>> QueryJobs(JobQuery query, CancellationToken cancellationToken = default)
Parameters
queryJobQueryWhat to select and which page of it to return.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
QueryTriggerGroups(TriggerGroupQuery, CancellationToken)
Lists trigger groups matching the query, ordered by name (ordinal).
public ValueTask<PagedResult<TriggerGroup>> QueryTriggerGroups(TriggerGroupQuery query, CancellationToken cancellationToken = default)
Parameters
queryTriggerGroupQueryWhat to select and which page of it to return.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
QueryTriggers(TriggerQuery, CancellationToken)
Lists triggers matching the query, as TriggerHeaders, ordered by group and then name (ordinal). The header carries the trigger's current state and execution group, so listing callers need no further round trips.
public ValueTask<PagedResult<TriggerHeader>> QueryTriggers(TriggerQuery query, CancellationToken cancellationToken = default)
Parameters
queryTriggerQueryWhat to select and which page of it to return.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- SchedulerException
The scheduler has been shut down.
RescheduleJob(TriggerKey, ITrigger, CancellationToken)
Remove (delete) the ITrigger with the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name & group specified)
- however, the new trigger need not have the same name as the old trigger.
public ValueTask<DateTimeOffset?> RescheduleJob(TriggerKey triggerKey, ITrigger newTrigger, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeyThe ITrigger to be replaced.
newTriggerITriggerThe new ITrigger to be stored.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
- ValueTask<DateTimeOffset?>
null if a ITrigger with the given name and group was not found and removed from the store (and the new trigger is therefore not stored), otherwise the first fire time of the newly scheduled trigger.
Exceptions
- ArgumentNullException
triggerKeyornewTriggeris null.- SchedulerException
The scheduler has been shut down; or
newTriggernames a calendar that is not registered, or will never fire; or it is not one of Quartz's own trigger implementations.
ResetTriggerFromErrorState(TriggerKey, CancellationToken)
public ValueTask<bool> ResetTriggerFromErrorState(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
- ValueTask<bool>
true if the trigger existed in the Error state and was reset by this call, false if there is no trigger with the given key or it was not in the error state.
Remarks
Only affects triggers that are in Error state - if identified trigger is not in that state then the result is a no-op.
The result will be the trigger returning to the normal, waiting to be fired state, unless the trigger's group has been paused, in which case it will go into the Paused state.
Exceptions
- ArgumentNullException
triggerKeyis null.- SchedulerException
The scheduler has been shut down.
- See Also
ResetTriggersFromErrorState(IReadOnlyCollection<TriggerKey>, CancellationToken)
public ValueTask<List<TriggerKey>> ResetTriggersFromErrorState(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<TriggerKey>>
The keys this call reset, in the order they were given. A key that names no trigger, or one that was not in the Error state, is simply absent, never a throw.
Remarks
The set is reset in one pass, under one lock or one connection. Resetting raises no scheduler-listener event and signals no scheduling change, in the plural exactly as in the singular — the reset triggers are picked up by the next acquisition cycle.
Exceptions
- ArgumentNullException
triggerKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
ResumeAll(CancellationToken)
Resume (un-pause) all triggers - similar to calling ResumeTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) on every group.
public ValueTask ResumeAll(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
If any ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
Exceptions
- SchedulerException
The scheduler has been shut down.
- See Also
ResumeJob(JobKey, CancellationToken)
Resume (un-pause) the IJobDetail with the given key.
public ValueTask<bool> ResumeJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
- ValueTask<bool>
true if the job exists — including a job that currently has no triggers — false if there is no job with the given key. No listener events are raised when nothing was found.
Remarks
If any of the IJob'sITrigger s missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
Exceptions
- ArgumentNullException
jobKeyis null.- SchedulerException
The scheduler has been shut down.
ResumeJobGroups(GroupMatcher<JobKey>, CancellationToken)
Resume (un-pause) the job groups that match, and the IJobDetails in them.
public ValueTask<List<string>> ResumeJobGroups(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<JobKey>cancellationTokenCancellationToken
Returns
Remarks
Forgets the group's pause, whatever matcher recorded it, so a group paused by a prefix matcher is resumed by one — which is why this answers with group names, as PauseJobGroups(GroupMatcher<JobKey>, CancellationToken) does, rather than with the keys ResumeJobs(IReadOnlyCollection<JobKey>, CancellationToken) answers with.
If any of the IJob s had ITrigger s that missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
Exceptions
- ArgumentNullException
matcheris null.- SchedulerException
The scheduler has been shut down.
- See Also
ResumeJobs(IReadOnlyCollection<JobKey>, CancellationToken)
Resume (un-pause) the IJobDetails with the given keys.
public ValueTask<List<JobKey>> ResumeJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<JobKey>>
The keys this call found, in the order they were given — a job with no triggers is found and so is present. A key that names no job is simply absent, never a throw.
Remarks
If any of the jobs' ITriggers missed one or more fire-times, then those triggers' misfire instructions will be applied.
One JobResumed(IScheduler, JobKey, CancellationToken) is raised per key the resume applied to, and the scheduling change is signalled once for the whole call. A key that was not found raises nothing.
Exceptions
- ArgumentNullException
jobKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
ResumeTrigger(TriggerKey, CancellationToken)
Resume (un-pause) the ITrigger with the given key.
public ValueTask<bool> ResumeTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
- ValueTask<bool>
true if the trigger existed in a paused state and was resumed by this call, false if there is no trigger with the given key or it was not paused. No listener events are raised when nothing changed.
Remarks
If the ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
Exceptions
- ArgumentNullException
triggerKeyis null.- SchedulerException
The scheduler has been shut down.
ResumeTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken)
Resume (un-pause) the trigger groups that match, and every ITrigger in them.
public ValueTask<List<string>> ResumeTriggerGroups(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<TriggerKey>cancellationTokenCancellationToken
Returns
Remarks
Forgets the group's pause, whatever matcher recorded it, so a group paused by a prefix matcher is resumed by one — which is why this answers with group names, as PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) does, rather than with the keys ResumeTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken) answers with.
If any ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
Exceptions
- ArgumentNullException
matcheris null.- SchedulerException
The scheduler has been shut down.
- See Also
ResumeTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
Resume (un-pause) the ITriggers with the given keys.
public ValueTask<List<TriggerKey>> ResumeTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<TriggerKey>>
The keys this call resumed, in the order they were given. A key that names no trigger, and one that was not paused, are each simply absent, never a throw.
Remarks
If a ITrigger missed one or more fire-times, then its misfire instruction will be applied.
One TriggerResumed(IScheduler, TriggerKey, CancellationToken) is raised per key the resume applied to, and the scheduling change is signalled once for the whole call. A key that did not move raises nothing.
Exceptions
- ArgumentNullException
triggerKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
ScheduleJob(IJobDetail, ITrigger, ScheduleJobOptions, CancellationToken)
Add the given IJobDetail to the Scheduler, and associate the given ITrigger with it.
public ValueTask<DateTimeOffset> ScheduleJob(IJobDetail jobDetail, ITrigger trigger, ScheduleJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
jobDetailIJobDetailThe job to store.
triggerITriggerThe trigger to store.
optionsScheduleJobOptionsWhether an already stored job or trigger with the same key is over-written. The whole operation is one store operation under one lock, so an upsert needs no read-then-write of its own and cannot lose a race with another node doing the same thing.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
If the given Trigger does not reference any IJob, then it will be set to reference the Job passed with it into this method.
Exceptions
- ArgumentNullException
jobDetailortriggeris null.- SchedulerException
The scheduler has been shut down; or
triggernames a different job, names a calendar that is not registered, or will never fire; or it is not one of Quartz's own trigger implementations.- ObjectAlreadyExistsException
The job or the trigger is already stored under the same key and Replace was not asked for.
ScheduleJob(IJobDetail, IReadOnlyCollection<ITrigger>, ScheduleJobOptions, CancellationToken)
Schedule the given job with the related set of triggers.
public ValueTask ScheduleJob(IJobDetail jobDetail, IReadOnlyCollection<ITrigger> triggersForJob, ScheduleJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
jobDetailIJobDetailtriggersForJobIReadOnlyCollection<ITrigger>optionsScheduleJobOptionscancellationTokenCancellationToken
Returns
Remarks
If any of the given job or triggers already exist (or more specifically, if the keys are not unique) and Replace is not set then an exception will be thrown.
Exceptions
- ArgumentNullException
jobDetailortriggersForJobis null.- SchedulerException
The scheduler has been shut down.
- ObjectAlreadyExistsException
The job or one of the triggers is already stored under the same key and Replace was not asked for. Nothing is stored.
ScheduleJob(ITrigger, ScheduleJobOptions, CancellationToken)
public ValueTask<DateTimeOffset> ScheduleJob(ITrigger trigger, ScheduleJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
triggerITriggerThe trigger to store.
optionsScheduleJobOptionsWhether an already stored trigger with the same key is over-written. Replacing is one store operation under the store's own lock, so scheduling over an existing trigger needs no
CheckExists/UnscheduleJob/ScheduleJobdance and cannot lose a race with another node doing the same thing.cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
A replaced trigger keeps its PreviousFireTimeUtc, so a job that reads PreviousFireTimeUtc is not told the schedule has never fired merely because its trigger was rewritten.
Exceptions
- ArgumentNullException
triggeris null.- SchedulerException
The scheduler has been shut down; or
triggernames a calendar that is not registered, or will never fire; or it is not one of Quartz's own trigger implementations.- ObjectAlreadyExistsException
A trigger is already stored under the same key and Replace was not asked for.
ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<ITrigger>>, ScheduleJobOptions, CancellationToken)
Schedule all the given jobs with the related set of triggers.
public ValueTask ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<ITrigger>> triggersAndJobs, ScheduleJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
triggersAndJobsIReadOnlyDictionary<IJobDetail, IReadOnlyCollection<ITrigger>>optionsScheduleJobOptionscancellationTokenCancellationToken
Returns
Remarks
If any of the given jobs or triggers already exist (or more specifically, if the keys are not unique) and Replace is not set then an exception will be thrown.
Exceptions
- ArgumentNullException
triggersAndJobsis null.- SchedulerException
The scheduler has been shut down.
- ObjectAlreadyExistsException
A key in the batch is already stored and Replace was not asked for. None of the batch is stored.
SetExecutionLimits(ExecutionLimits?, CancellationToken)
Sets the execution group limits this scheduler enforces. Execution groups allow thread limits - per node or across the cluster, as each limit's ExecutionLimitScope says - so that resource-intensive jobs do not saturate all available threads.
public ValueTask SetExecutionLimits(ExecutionLimits? limits, CancellationToken cancellationToken = default)
Parameters
limitsExecutionLimitsThe execution limits to apply, or null to clear.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
Limits take effect on the next trigger acquisition cycle. Pass null to clear all limits.
Shutdown(bool, CancellationToken)
Halts the IScheduler's firing of ITriggers, and cleans up all resources associated with the Scheduler.
public ValueTask Shutdown(bool waitForJobsToComplete = false, CancellationToken cancellationToken = default)
Parameters
waitForJobsToCompleteboolif true the scheduler will not allow this method to return until all currently executing jobs have completed. If false it waits for no job, but still gives the executions already in flight a couple of seconds to report their completions, so that a firing which ends on the way out is recorded rather than left for a peer to recover; one still working when that window closes is abandoned.
cancellationTokenCancellationTokenBounds the wait for running jobs, so that a shutdown can be given a deadline. Cancelling it stops the scheduler waiting; it does not cancel the jobs, and the shutdown itself always runs to the end, so the job store, the plugins and the listeners are told the scheduler has stopped either way.
Returns
Remarks
The scheduler cannot be re-started.
The scheduler is ShuttingDown for the duration and Shutdown once its plugins and job store are down. It does not pass through Standby on the way, and no listener is told it stood down: a scheduler being torn down is not one waiting to be started again.
Firing stops before anything is torn down, so a trigger this scheduler had reserved is released
for another node and one it had already fired is still run. What it does about the executions
under way is waitForJobsToComplete's answer.
Standby(CancellationToken)
Temporarily halts the IScheduler's firing of ITriggers.
public ValueTask Standby(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
When Start(CancellationToken) is called (to bring the scheduler out of stand-by mode), trigger misfire instructions will NOT be applied during the execution of the Start(CancellationToken) method - any misfires will be detected immediately afterward (by the IJobStore's normal process).
The scheduler is not destroyed, and can be re-started at any time. A scheduler that is running becomes Standby.
Standing down a scheduler that is not running does nothing at all: no listener is told it went into standby, and the job store is not told it paused, because neither happened. A scheduler that has never been started is already firing nothing and stays Created, which is the more precise answer than standby; one already in standby is in the state being asked for.
Exceptions
- SchedulerException
The scheduler has been shut down, or is shutting down. Neither is a state to be stood down from.
- See Also
Start(CancellationToken)
Starts the IScheduler's threads that fire ITriggers, taking it to Running. A newly built scheduler is Created and fires nothing until this is called; so is one that Standby(CancellationToken) has stood down.
public ValueTask Start(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
The misfire/recovery process will be started, if it is the initial call to this method on this scheduler instance.
Starting a scheduler that is already Running does nothing at all: no listener is told the scheduler started, and the job store is not told it resumed, because neither happened.
Exceptions
- SchedulerException
The scheduler has been shut down, or is shutting down. That is terminal, so there is nothing to start.
- See Also
StartDelayed(TimeSpan, CancellationToken)
Calls Start(CancellationToken) after the indicated delay. (This call does not block). This can be useful within applications that have initializers that create the scheduler immediately, before the resources needed by the executing jobs have been fully initialized.
public ValueTask StartDelayed(TimeSpan delay, CancellationToken cancellationToken = default)
Parameters
delayTimeSpancancellationTokenCancellationToken
Returns
Exceptions
- SchedulerException
The scheduler has been shut down, and cannot be restarted.
- ArgumentOutOfRangeException
delayis negative, or longer than a timer will wait.
- See Also
TriggerJob(JobKey, JobDataMap?, CancellationToken)
Trigger the identified IJobDetail (Execute it now).
public ValueTask TriggerJob(JobKey jobKey, JobDataMap? data = null, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeydataJobDataMapthe (possibly null) JobDataMap to be associated with the trigger that fires the job immediately.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exceptions
- ArgumentNullException
jobKeyis null.- SchedulerException
The scheduler has been shut down.
- JobPersistenceException
No job is stored under
jobKey.
UnscheduleJob(TriggerKey, CancellationToken)
Remove the indicated ITrigger from the scheduler.
If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.
public ValueTask<bool> UnscheduleJob(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
Exceptions
- ArgumentNullException
triggerKeyis null.- SchedulerException
The scheduler has been shut down.
UnscheduleJobs(GroupMatcher<TriggerKey>, CancellationToken)
Remove every ITrigger in the matching groups from the scheduler.
public ValueTask<List<TriggerKey>> UnscheduleJobs(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<TriggerKey>Selects the trigger groups to empty. Required — there is no "unschedule the default group" reading of null worth risking on a destructive call.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
- ValueTask<List<TriggerKey>>
The keys of the triggers this call removed.
Remarks
The group is the correlation axis: everything scheduled for one saga, one tenant or one conversation shares a trigger group, and this is how the whole of it is called off in one call rather than one round trip per key — and without first listing the keys, which is a window in which another node can add one more.
A job left with no triggers by the removal is deleted too if it is not durable, exactly as the single-key UnscheduleJob(TriggerKey, CancellationToken) does, but the answer names triggers only.
One JobUnscheduled(IScheduler, TriggerKey, CancellationToken) is raised per removed key, and the scheduling change is signalled once for the whole call. A matcher that matched nothing raises nothing.
Exceptions
- ArgumentNullException
matcheris null.- SchedulerException
The scheduler has been shut down.
- See Also
UnscheduleJobs(IReadOnlyCollection<TriggerKey>, CancellationToken)
Remove all of the indicated ITriggers from the scheduler.
public ValueTask<List<TriggerKey>> UnscheduleJobs(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
- ValueTask<List<TriggerKey>>
The keys this call removed, in the order they were given. A key that names no trigger is simply absent, never a throw —
result.Count == triggerKeys.Countis the "every key was found" answer, and the list itself says which ones when it is not.
Remarks
If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.
Note that while this bulk operation is likely more efficient than invoking UnscheduleJob(TriggerKey, CancellationToken) several times, it may have the adverse affect of holding data locks for a single long duration of time (rather than lots of small durations of time).
One JobUnscheduled(IScheduler, TriggerKey, CancellationToken) is raised per key the removal applied to, and the scheduling change is signalled once for the whole call. A key that was not found raises nothing, as the single-key form raises nothing when it answers false.
Exceptions
- ArgumentNullException
triggerKeysis null.- SchedulerException
The scheduler has been shut down.
- See Also
UpdateTriggerDetails(TriggerKey, TriggerDetailsUpdate, CancellationToken)
Updates trigger metadata and selected settings without rescheduling. Fire times and trigger state are preserved. Supported properties are the description, priority, job data map, calendar name, misfire instruction, execution group and preferred node.
public ValueTask<bool> UpdateTriggerDetails(TriggerKey triggerKey, TriggerDetailsUpdate update, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeyThe key identifying the trigger to update.
updateTriggerDetailsUpdateThe details to update. See TriggerDetailsUpdate for available properties.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
The body carries only what the update set, so a member the caller never touched is not sent and
the trigger keeps it. The schedule family of a misfire instruction travels too, which is what
keeps WithMisfireInstruction rejected by the store for a trigger of another family here
exactly as it is in process.
Exceptions
- ArgumentNullException
triggerKeyorupdateis null.- SchedulerException
The scheduler has been shut down.