Table of Contents

Interface IJobStore

Namespace
Quartz.Extensibility
Assembly
Quartz.dll

The interface to be implemented by classes that want to provide a IJob and ITrigger storage mechanism for a scheduler's use.

public interface IJobStore

Remarks

Storage of IJob s and ITrigger s should be keyed on the combination of their name and group for uniqueness.

Properties

Clustered

Whether the IJobStore implementation is clustered.

bool Clustered { get; }

Property Value

bool

Remarks

Read-only, because being clustered is something a store is rather than something it is told: the ADO.NET store reports what Enabled says, and a store that cannot cluster answers false and means it.

EstimatedTimeToReleaseAndAcquireTrigger

How long the IJobStore implementation estimates that it will take to release a trigger and acquire a new one.

TimeSpan EstimatedTimeToReleaseAndAcquireTrigger { get; }

Property Value

TimeSpan

SupportsPersistence

Indicates whether job store supports persistence.

bool SupportsPersistence { get; }

Property Value

bool

SupportsStoringPaused

Whether the store honours Paused and Paused, storing a trigger paused in the operation that stores it.

bool SupportsStoringPaused { get; }

Property Value

bool

Remarks

A default interface member, added in 4.4, answering false. A store that answers so is handed Replace alone, as before 4.4, and the scheduler then pauses each trigger through PauseTriggerWith(TriggerKey, PauseDetails?, CancellationToken), so a trigger due at once can fire in between. Answer true once AddTrigger(IOperableTrigger, AddTriggerOptions, CancellationToken) and ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<IOperableTrigger>>, ScheduleJobOptions, CancellationToken) honour the option. Every store Quartz ships does.

Methods

AcquireNextTriggers(TriggerAcquisitionRequest, CancellationToken)

Acquires the next triggers to be fired, respecting execution group limits.

ValueTask<List<IOperableTrigger>> AcquireNextTriggers(TriggerAcquisitionRequest request, CancellationToken cancellationToken = default)

Parameters

request TriggerAcquisitionRequest

What to acquire: the cut-off time, how many, the batching window and the per-execution-group capacity still available.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<IOperableTrigger>>

The acquired triggers. The caller copies this list rather than taking it over, so it may be one the store keeps.

Remarks

The returned list stays the store's. The scheduler's acquisition loop copies it before working with it, because it removes entries from its own copy while it waits out the first trigger's fire time and would otherwise be editing something the store still holds. A store is therefore free to hand back a list it keeps a reference to, or to reuse one between calls; it does not have to build a fresh list to be safe. The copy costs the scheduler around ten nanoseconds and sixty-four bytes per acquisition attempt (AcquiredTriggerHandoffBenchmark), against an attempt that is a database round trip, and is kept in preference to a caller-owns rule that every store would have to keep and that would break silently in one that did not (#3344).

AcquireNextTriggersAndFireDue(TriggerAcquisitionRequest, CancellationToken)

Acquires the next triggers to be fired, as AcquireNextTriggers(TriggerAcquisitionRequest, CancellationToken) does, and fires the ones already due in the same operation. This is the member the scheduler calls.

ValueTask<TriggerAcquisitionResult> AcquireNextTriggersAndFireDue(TriggerAcquisitionRequest request, CancellationToken cancellationToken = default)

Parameters

request TriggerAcquisitionRequest

What to acquire, as for AcquireNextTriggers(TriggerAcquisitionRequest, CancellationToken).

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<TriggerAcquisitionResult>

What was acquired, and what became of the triggers fired as they were.

Remarks

A trigger is due when its NextFireTimeUtc is at or before the store's clock when it acquires it. The store fires those as TriggersFired(IReadOnlyCollection<IOperableTrigger>, CancellationToken) would and answers them in Due and Fired; the rest, due later within the batch window, are Pending, which the scheduler waits for and fires with TriggersFired(IReadOnlyCollection<IOperableTrigger>, CancellationToken). A persistent store saves the second transaction a round of already-due triggers used to cost.

A default interface member, so a store written against an earlier 4.x keeps working. The default fires nothing: it calls AcquireNextTriggers(TriggerAcquisitionRequest, CancellationToken) and answers everything as pending, which is exactly what the scheduler did with that answer before. A new name rather than an overload, because PublicApiGenerator marks default implementations per method name.

AddCalendar(string, ICalendar, AddCalendarOptions, CancellationToken)

Store the given ICalendar.

ValueTask AddCalendar(string calendarName, ICalendar calendar, AddCalendarOptions options = default, CancellationToken cancellationToken = default)

Parameters

calendarName string

The name.

calendar ICalendar

The ICalendar to be stored.

options AddCalendarOptions

Whether an existing calendar of the same name may be over-written, and whether the triggers referencing it have their next fire time re-computed. Defaults to neither.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Exceptions

ObjectAlreadyExistsException

A calendar is already stored under the same name and Replace was not asked for.

AddJob(IJobDetail, AddJobOptions, CancellationToken)

Store the given IJobDetail.

ValueTask AddJob(IJobDetail job, AddJobOptions options = default, CancellationToken cancellationToken = default)

Parameters

job IJobDetail

The IJobDetail to be stored.

options AddJobOptions

How to store it. Replace over-writes a job already stored under the same key; without it, storing one whose key exists throws ObjectAlreadyExistsException. StoreNonDurableWhileAwaitingScheduling is a scheduler-level rule that IScheduler has already applied by the time the store is called, so a store neither reads it nor has anything to do about it.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

AddTrigger(IOperableTrigger, AddTriggerOptions, CancellationToken)

Store the given ITrigger.

ValueTask AddTrigger(IOperableTrigger trigger, AddTriggerOptions options = default, CancellationToken cancellationToken = default)

Parameters

trigger IOperableTrigger

The ITrigger to be stored.

options AddTriggerOptions

How to store it. Replace over-writes a trigger already stored under the same key; without it, storing one whose key exists throws ObjectAlreadyExistsException. Paused stores it paused; it reaches only a store that says SupportsStoringPaused.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Exceptions

ObjectAlreadyExistsException

A trigger is already stored under the same key and Replace was not asked for.

Clear(CancellationToken)

Clear (delete!) all scheduling data - all IJobs, ITriggers and ICalendars.

ValueTask Clear(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask

DeleteCalendar(string, CancellationToken)

Remove (delete) the ICalendar with the given name.

ValueTask<bool> DeleteCalendar(string calendarName, CancellationToken cancellationToken = default)

Parameters

calendarName string

The name of the ICalendar to be removed.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true if a ICalendar with the given name was found and removed from the store.

Remarks

If removal of the ICalendar would result in ITriggers pointing to non-existent calendars, then a JobPersistenceException will be thrown.

DeleteJob(JobKey, CancellationToken)

Remove (delete) the IJob with the given key, and any ITrigger s that reference it.

ValueTask<bool> DeleteJob(JobKey jobKey, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey
cancellationToken CancellationToken

Returns

ValueTask<bool>

true if a IJob with the given name and group was found and removed from the store.

Remarks

If removal of the IJob results in an empty group, the group should be removed from the IJobStore's list of known group names.

DeleteJobs(GroupMatcher<JobKey>, CancellationToken)

Remove (delete) every IJob in the matching groups, and any ITriggers that reference them.

ValueTask<List<JobKey>> DeleteJobs(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<JobKey>
cancellationToken CancellationToken

Returns

ValueTask<List<JobKey>>

The keys this call removed. A group that matched nothing contributes nothing — an empty list is the plural of the single-key false, not a failure.

Remarks

The default implementation lists the matching keys and then deletes them, which is two operations and so lets a job added in between escape. A store overrides it to resolve the keys and delete them under the same lock or connection scope; the answer must not change when it does.

See Also

DeleteJobs(IReadOnlyCollection<JobKey>, CancellationToken)

Remove (delete) the IJobs with the given keys, and any ITriggers that reference them.

ValueTask<List<JobKey>> DeleteJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)

Parameters

jobKeys IReadOnlyCollection<JobKey>
cancellationToken CancellationToken

Returns

ValueTask<List<JobKey>>

The keys this call removed, in the order they were given. A key that names no job is simply absent — the plural of the single-key bool, not a failure.

Remarks

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

DeleteTrigger(TriggerKey, CancellationToken)

Remove (delete) the ITrigger with the given key.

ValueTask<bool> DeleteTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey
cancellationToken CancellationToken

Returns

ValueTask<bool>

true if a ITrigger with the given name and group was found and removed from the store.

Remarks

If removal of the ITrigger results in an empty group, the group should be removed from the IJobStore's list of known group names.

If removal of the ITrigger results in an 'orphaned' IJob that is not 'durable', then the IJob should be deleted also.

DeleteTriggers(GroupMatcher<TriggerKey>, CancellationToken)

Remove (delete) every ITrigger in the matching groups.

ValueTask<List<TriggerKey>> DeleteTriggers(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<TriggerKey>
cancellationToken CancellationToken

Returns

ValueTask<List<TriggerKey>>

The keys this call removed. A job left orphaned and non-durable by the removal is deleted too, as in the single-key form, but the answer names triggers only.

Remarks

The default implementation lists the matching keys and then deletes them, which is two operations and so lets a trigger added in between escape. A store overrides it to resolve the keys and delete them under the same lock or connection scope; the answer must not change when it does.

See Also

DeleteTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)

Remove (delete) the ITriggers with the given keys.

ValueTask<List<TriggerKey>> DeleteTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)

Parameters

triggerKeys IReadOnlyCollection<TriggerKey>
cancellationToken CancellationToken

Returns

ValueTask<List<TriggerKey>>

The keys this call removed, in the order they were given. A key that names no trigger is simply absent — the plural of the single-key bool, not a failure. A job left orphaned and non-durable by the removal is deleted too, as in the single-key form, but the answer names triggers only.

Remarks

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

Exists(JobKey, CancellationToken)

Determine whether a IJob with the given identifier already exists within the scheduler.

ValueTask<bool> Exists(JobKey jobKey, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey

the identifier to check for

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true if a job exists with the given identifier

Exists(TriggerKey, CancellationToken)

Determine whether a ITrigger with the given identifier already exists within the scheduler.

ValueTask<bool> Exists(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey

the identifier to check for

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true if a trigger exists with the given identifier

Exists(string, CancellationToken)

Determine whether an ICalendar with the given name already exists within the store.

ValueTask<bool> Exists(string calendarName, CancellationToken cancellationToken = default)

Parameters

calendarName string

the name to check for

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true if a calendar is stored under the given name

Remarks

Answer this without materializing the calendar. GetCalendar(string, CancellationToken) can answer it too, but only by reading the stored blob and deserializing it to throw it away — which is what a store implementing this member as GetCalendar(name) is not null would go on doing.

FiringComplete(TriggeredJobCompleteContext, CancellationToken)

The same completion, with everything the run shell learned about the firing: how it ended, and the exception it ended with. This is the member the scheduler calls.

ValueTask FiringComplete(TriggeredJobCompleteContext context, CancellationToken cancellationToken = default)

Parameters

context TriggeredJobCompleteContext

The firing that completed, and how it ended.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Remarks

The outcome is what settles the continuations waiting on the trigger — released when it matches their condition, discarded when it does not — inside the same lock and transaction as the rest of the completion, so a crash cannot leave one half-settled.

A default interface member, so a store written against an earlier 4.x keeps working: the default drops the outcome and calls TriggeredJobComplete(IOperableTrigger, IJobDetail, SchedulerInstruction, CancellationToken), which is exactly what such a store already does. It is a new name rather than an overload of that one because PublicApiGenerator marks default implementations per method name, and an overload would make the API baseline claim the abstract member is a default too.

GetAcquireRetryDelay(int)

Get the amount of time to wait when accessing this job store repeatedly fails.

TimeSpan GetAcquireRetryDelay(int failureCount)

Parameters

failureCount int

the number of successive failures seen so far

Returns

TimeSpan

the time to wait before trying again

Remarks

Called by the executor thread(s) when calls to AcquireNextTriggers fail more than once in succession, and the thread thus wants to wait a bit before trying again, to not consume 100% CPU, write huge amounts of errors into logs, etc. in cases like the DB being offline/restarting.

The delay returned by implementations should be between 20 milliseconds and 10 minutes.

GetCalendar(string, CancellationToken)

Retrieve the given ICalendar.

ValueTask<ICalendar?> GetCalendar(string calendarName, CancellationToken cancellationToken = default)

Parameters

calendarName string

The name of the ICalendar to be retrieved.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<ICalendar>

The desired ICalendar, or null if there is no match.

GetInterruptRequests(CancellationToken)

The fire instance ids of this node's executing firings that carry an interrupt request RequestInterrupt(string, CancellationToken) recorded.

ValueTask<List<string>> GetInterruptRequests(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<string>>

Remarks

The scheduler asks this when the store says it is time to, and interrupts each of the firings named that it is running and has not interrupted yet. A request stays recorded until its firing completes, so the same id may be answered more than once.

A default interface member, added in 4.6. The default answers an empty list.

GetJob(JobKey, CancellationToken)

Retrieve the IJobDetail for the given IJob.

ValueTask<IJobDetail?> GetJob(JobKey jobKey, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey
cancellationToken CancellationToken

Returns

ValueTask<IJobDetail>

The desired IJob, or null if there is no match.

GetJobGroupPause(string, CancellationToken)

The pause recorded for the job group, while it is paused.

ValueTask<PauseInfo?> GetJobGroupPause(string groupName, CancellationToken cancellationToken = default)

Parameters

groupName string

The job group to ask about.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PauseInfo>

Remarks

null when the group is not paused, or was paused without a reason. A default interface member, whose default answers null.

GetJobs(IReadOnlyCollection<JobKey>, CancellationToken)

Retrieves the given jobs in one round trip. Keys that do not exist are simply absent from the result.

ValueTask<List<IJobDetail>> GetJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)

Parameters

jobKeys IReadOnlyCollection<JobKey>

The keys of the jobs to retrieve.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<IJobDetail>>

GetTrigger(TriggerKey, CancellationToken)

Retrieve the given ITrigger.

ValueTask<IOperableTrigger?> GetTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey
cancellationToken CancellationToken

Returns

ValueTask<IOperableTrigger>

The desired ITrigger, or null if there is no match.

GetTriggerGroupPause(string, CancellationToken)

The pause recorded for the trigger group, while it is paused.

ValueTask<PauseInfo?> GetTriggerGroupPause(string groupName, CancellationToken cancellationToken = default)

Parameters

groupName string

The trigger group to ask about.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PauseInfo>

Remarks

null when the group is not paused, or was paused without a reason. A default interface member, whose default answers null.

GetTriggerPause(TriggerKey, CancellationToken)

The pause recorded for the trigger, while it is paused.

ValueTask<PauseInfo?> GetTriggerPause(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey

The trigger to ask about.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PauseInfo>

Remarks

The pause a *With member recorded on the trigger itself. A trigger that is paused without a record of its own — one stored into a group that was already paused — answers its trigger group's record, and then its job group's.

null when the trigger does not exist, is not paused, or was paused by something that records nothing: a reasonless pause, a scheduler or store written against an earlier 4.x, or a 4.2 node sharing the database. A record is answered only while the trigger is paused, so what such a node's resume left behind is never reported for a trigger that is running. A default interface member, whose default answers null.

GetTriggerState(TriggerKey, CancellationToken)

Get the current state of the identified ITrigger.

ValueTask<TriggerState> GetTriggerState(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey
cancellationToken CancellationToken

Returns

ValueTask<TriggerState>
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.

ValueTask<List<IOperableTrigger>> GetTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)

Parameters

triggerKeys IReadOnlyCollection<TriggerKey>

The keys of the triggers to retrieve.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<IOperableTrigger>>

GetTriggersForJob(JobKey, CancellationToken)

Get all the Triggers that are associated to the given Job.

ValueTask<List<IOperableTrigger>> GetTriggersForJob(JobKey jobKey, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey
cancellationToken CancellationToken

Returns

ValueTask<List<IOperableTrigger>>

Remarks

If there are no matches, a zero-length array should be returned.

Initialize(SchedulerIdentity, CancellationToken)

Called before the IJobStore is used, to give it a chance to initialize.

ValueTask Initialize(SchedulerIdentity identity, CancellationToken cancellationToken = default)

Parameters

identity SchedulerIdentity

The scheduler this store stores for, and the node it is running on. A store records the instance id against the firings this node owns, so that QueryFireInstances(FireInstanceQuery, CancellationToken) can say which node is running what.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Remarks

Nearly everything a job store needs — the type loader, the signaler, the time provider — is supplied through its constructor. What remains here is the scheduler's identity, which is not settled until the container has built the graph, and work that has to happen before the scheduler runs and cannot be done during construction, such as verifying a database schema.

PauseAll(CancellationToken)

Pause all triggers - equivalent of calling PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) on every group.

When ResumeAll(CancellationToken) is called (to un-pause), trigger misfire instructions WILL be applied.

ValueTask PauseAll(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask
See Also

PauseAllWith(PauseDetails?, CancellationToken)

PauseAll(CancellationToken), recording why and who asked on each group and trigger this call pauses.

ValueTask PauseAllWith(PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Remarks

Every *With pause member, here and on IJobStore, is its reasonless twin with a record. The store stamps the details with the scheduler's clock, cuts texts longer than MaxReasonLength and MaxRequestedByLength, and keeps them on each trigger and group the call moves into the paused state until it is resumed; GetTriggerPause(TriggerKey, CancellationToken), GetTriggerGroupPause(string, CancellationToken) and GetJobGroupPause(string, CancellationToken) read them back. A trigger or group that was already paused keeps the pause it had.

null, or details that say nothing, is exactly the reasonless twin — the same writes, through the same extension points — and records nothing.

A default interface member, whose default drops the details and calls the reasonless twin, which is what a scheduler or store written against an earlier 4.x does. A new name rather than an overload, because the API baseline marks default implementations per name.

PauseJob(JobKey, CancellationToken)

Pause the IJob with the given key - by pausing all of its current ITriggers.

ValueTask<bool> PauseJob(JobKey jobKey, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey
cancellationToken CancellationToken

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.

PauseJobGroups(GroupMatcher<JobKey>, CancellationToken)

Pause the job groups that match - by pausing all of the ITriggers of the IJobs in them.

ValueTask<List<string>> PauseJobGroups(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<JobKey>
cancellationToken CancellationToken

Returns

ValueTask<List<string>>

The names of the job groups that are recorded as paused by this call.

Remarks

The JobStore should "remember" that the group is paused, and impose the pause on any new jobs that are added to the group while the group is paused. That memory is what this answers with — the names of the groups now recorded as paused, which is not the set of keys that moved: an equality matcher records a group that holds no job yet.

PauseJobGroupsWith(GroupMatcher<JobKey>, PauseDetails?, CancellationToken)

PauseJobGroups(GroupMatcher<JobKey>, CancellationToken), recording why and who asked on each group this call pauses and on each trigger it moves.

ValueTask<List<string>> PauseJobGroupsWith(GroupMatcher<JobKey> matcher, PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<JobKey>

The groups to pause.

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<string>>

What PauseJobGroups(GroupMatcher<JobKey>, CancellationToken) returns.

Remarks

Every *With pause member, here and on IJobStore, is its reasonless twin with a record. The store stamps the details with the scheduler's clock, cuts texts longer than MaxReasonLength and MaxRequestedByLength, and keeps them on each trigger and group the call moves into the paused state until it is resumed; GetTriggerPause(TriggerKey, CancellationToken), GetTriggerGroupPause(string, CancellationToken) and GetJobGroupPause(string, CancellationToken) read them back. A trigger or group that was already paused keeps the pause it had.

null, or details that say nothing, is exactly the reasonless twin — the same writes, through the same extension points — and records nothing.

A default interface member, whose default drops the details and calls the reasonless twin, which is what a scheduler or store written against an earlier 4.x does. A new name rather than an overload, because the API baseline marks default implementations per name.

PauseJobWith(JobKey, PauseDetails?, CancellationToken)

PauseJob(JobKey, CancellationToken), recording why and who asked on each trigger of the job this call pauses.

ValueTask<bool> PauseJobWith(JobKey jobKey, PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey

The job whose triggers to pause.

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

What PauseJob(JobKey, CancellationToken) returns.

Remarks

Every *With pause member, here and on IJobStore, is its reasonless twin with a record. The store stamps the details with the scheduler's clock, cuts texts longer than MaxReasonLength and MaxRequestedByLength, and keeps them on each trigger and group the call moves into the paused state until it is resumed; GetTriggerPause(TriggerKey, CancellationToken), GetTriggerGroupPause(string, CancellationToken) and GetJobGroupPause(string, CancellationToken) read them back. A trigger or group that was already paused keeps the pause it had.

null, or details that say nothing, is exactly the reasonless twin — the same writes, through the same extension points — and records nothing.

A default interface member, whose default drops the details and calls the reasonless twin, which is what a scheduler or store written against an earlier 4.x does. A new name rather than an overload, because the API baseline marks default implementations per name.

PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken)

Pause the IJobs with the given keys - by pausing all of their current ITriggers.

ValueTask<List<JobKey>> PauseJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)

Parameters

jobKeys IReadOnlyCollection<JobKey>
cancellationToken CancellationToken

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 — the plural of the single-key bool, not a failure.

Remarks

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

PauseJobsWith(IReadOnlyCollection<JobKey>, PauseDetails?, CancellationToken)

PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken), recording why and who asked on each trigger of the jobs this call pauses.

ValueTask<List<JobKey>> PauseJobsWith(IReadOnlyCollection<JobKey> jobKeys, PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

jobKeys IReadOnlyCollection<JobKey>

The jobs whose triggers to pause.

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<JobKey>>

What PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken) returns.

Remarks

A store overrides it to pause the set inside one lock and one transaction; the answer must not change when it does. null, or details that say nothing, is exactly PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken).

A default interface member, added in 4.4. Unlike the other *With defaults, it keeps the details: details that say something go to PauseJobWith(JobKey, PauseDetails?, CancellationToken) one key at a time, so a store written against 4.3 still records them.

PauseTrigger(TriggerKey, CancellationToken)

Pause the ITrigger with the given key.

ValueTask<bool> PauseTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey
cancellationToken CancellationToken

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).

PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken)

Pause the trigger groups that match, and every ITrigger in them.

ValueTask<List<string>> PauseTriggerGroups(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<TriggerKey>
cancellationToken CancellationToken

Returns

ValueTask<List<string>>

The names of the trigger groups that are recorded as paused by this call.

Remarks

The JobStore should "remember" that the group is paused, and impose the pause on any new triggers that are added to the group while the group is paused. That memory is what this answers with — the names of the groups now recorded as paused, which is not the set of keys that moved: an equality matcher records a group that holds no trigger yet.

PauseTriggerGroupsWith(GroupMatcher<TriggerKey>, PauseDetails?, CancellationToken)

PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken), recording why and who asked on each group this call pauses and on each trigger it moves.

ValueTask<List<string>> PauseTriggerGroupsWith(GroupMatcher<TriggerKey> matcher, PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<TriggerKey>

The groups to pause.

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<string>>

What PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) returns.

Remarks

Every *With pause member, here and on IJobStore, is its reasonless twin with a record. The store stamps the details with the scheduler's clock, cuts texts longer than MaxReasonLength and MaxRequestedByLength, and keeps them on each trigger and group the call moves into the paused state until it is resumed; GetTriggerPause(TriggerKey, CancellationToken), GetTriggerGroupPause(string, CancellationToken) and GetJobGroupPause(string, CancellationToken) read them back. A trigger or group that was already paused keeps the pause it had.

null, or details that say nothing, is exactly the reasonless twin — the same writes, through the same extension points — and records nothing.

A default interface member, whose default drops the details and calls the reasonless twin, which is what a scheduler or store written against an earlier 4.x does. A new name rather than an overload, because the API baseline marks default implementations per name.

PauseTriggerWith(TriggerKey, PauseDetails?, CancellationToken)

PauseTrigger(TriggerKey, CancellationToken), recording why and who asked on the trigger if this call pauses it.

ValueTask<bool> PauseTriggerWith(TriggerKey triggerKey, PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey

The trigger to pause.

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

What PauseTrigger(TriggerKey, CancellationToken) returns.

Remarks

Every *With pause member, here and on IJobStore, is its reasonless twin with a record. The store stamps the details with the scheduler's clock, cuts texts longer than MaxReasonLength and MaxRequestedByLength, and keeps them on each trigger and group the call moves into the paused state until it is resumed; GetTriggerPause(TriggerKey, CancellationToken), GetTriggerGroupPause(string, CancellationToken) and GetJobGroupPause(string, CancellationToken) read them back. A trigger or group that was already paused keeps the pause it had.

null, or details that say nothing, is exactly the reasonless twin — the same writes, through the same extension points — and records nothing.

A default interface member, whose default drops the details and calls the reasonless twin, which is what a scheduler or store written against an earlier 4.x does. A new name rather than an overload, because the API baseline marks default implementations per name.

PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)

Pause the ITriggers with the given keys.

ValueTask<List<TriggerKey>> PauseTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)

Parameters

triggerKeys IReadOnlyCollection<TriggerKey>
cancellationToken CancellationToken

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 — the plural of the single-key bool, not a failure.

Remarks

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

PauseTriggersWith(IReadOnlyCollection<TriggerKey>, PauseDetails?, CancellationToken)

PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken), recording why and who asked on each trigger this call pauses.

ValueTask<List<TriggerKey>> PauseTriggersWith(IReadOnlyCollection<TriggerKey> triggerKeys, PauseDetails? details, CancellationToken cancellationToken = default)

Parameters

triggerKeys IReadOnlyCollection<TriggerKey>

The triggers to pause.

details PauseDetails

Why, and who asked; null for the reasonless pause.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<TriggerKey>>

What PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken) returns.

Remarks

A store overrides it to pause the set inside one lock and one transaction, stamping every trigger with the same instant; the answer must not change when it does. A trigger that was already paused keeps the pause it had. null, or details that say nothing, is exactly PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken).

A default interface member, added in 4.4. Unlike the other *With defaults, it keeps the details: details that say something go to PauseTriggerWith(TriggerKey, PauseDetails?, CancellationToken) one key at a time, so a store written against 4.3, which records them there, still records them.

QueryCalendarNames(CalendarQuery, CancellationToken)

Lists calendar names matching the query, ordered by name (ordinal).

ValueTask<PagedResult<string>> QueryCalendarNames(CalendarQuery query, CancellationToken cancellationToken = default)

Parameters

query CalendarQuery

Which names to select and which page of them to return.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PagedResult<string>>

QueryClusterNodes(CancellationToken)

Lists the scheduler nodes this store knows about, as ClusterNodes: the current node first, then the rest by instance id (ordinal).

ValueTask<List<ClusterNode>> QueryClusterNodes(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<List<ClusterNode>>

Remarks

The current node is always in the list, whether or not the store has a record of it yet, and it is the only one whose IsCurrentNode is true. A store that keeps no check-in history — the in-memory one, and a persistent one that is not clustered — answers with that single node, Alive and with no times, because a lone node has nobody to be late for.

A clustered store reports every node it has a check-in record for, including nodes that are dead but not yet swept, and decides State with the same predicate its recovery pass uses — so a node this listing calls Failed is a node whose work the cluster is about to take over, rather than one that merely looks late to a second opinion.

Unpaged, because a cluster is a handful of nodes rather than a data set; the listing that does need paging is QueryFireInstances(FireInstanceQuery, CancellationToken), which reports what each node is running.

QueryFireInstances(FireInstanceQuery, CancellationToken)

Lists firings matching the query, as FireInstances, ordered by trigger group, then trigger name, then fire instance id (all ordinal).

ValueTask<PagedResult<FireInstance>> QueryFireInstances(FireInstanceQuery query, CancellationToken cancellationToken = default)

Parameters

query FireInstanceQuery

What to select and which page of it to return.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PagedResult<FireInstance>>

Remarks

The tiebreaker is what makes a page deterministic here: one trigger can have several firings in flight, so a store must not collapse them and must not order two of them arbitrarily.

A store that keeps firings durably answers for the whole cluster; the in-memory store answers for its own process, which is the whole of its world. Either way the reported SchedulerInstanceId is the id the owning node was initialized with.

QueryJobGroups(JobGroupQuery, CancellationToken)

Lists job groups matching the query, ordered by name (ordinal).

ValueTask<PagedResult<JobGroup>> QueryJobGroups(JobGroupQuery query, CancellationToken cancellationToken = default)

Parameters

query JobGroupQuery

What to select and which page of it to return.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PagedResult<JobGroup>>

QueryJobs(JobQuery, CancellationToken)

Lists jobs matching the query, as JobHeaders, ordered by group and then name (ordinal).

ValueTask<PagedResult<JobHeader>> QueryJobs(JobQuery query, CancellationToken cancellationToken = default)

Parameters

query JobQuery

What to select and which page of it to return.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PagedResult<JobHeader>>

Remarks

A listing must not load or deserialize job data. When the query sets IncludeTotalCount, the result carries the total number of matching jobs regardless of paging.

QueryTriggerGroups(TriggerGroupQuery, CancellationToken)

Lists trigger groups matching the query, ordered by name (ordinal).

ValueTask<PagedResult<TriggerGroup>> QueryTriggerGroups(TriggerGroupQuery query, CancellationToken cancellationToken = default)

Parameters

query TriggerGroupQuery

What to select and which page of it to return.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PagedResult<TriggerGroup>>

Remarks

With Paused set to true, the listing reports every paused group, including a group that is paused but currently has no triggers.

QueryTriggers(TriggerQuery, CancellationToken)

Lists triggers matching the query, as TriggerHeaders, ordered by group and then name (ordinal).

ValueTask<PagedResult<TriggerHeader>> QueryTriggers(TriggerQuery query, CancellationToken cancellationToken = default)

Parameters

query TriggerQuery

What to select and which page of it to return.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<PagedResult<TriggerHeader>>

Remarks

A listing must not materialize triggers or their job data. The header carries the trigger's current state and execution group, so listing callers need no further round trips.

ReleaseAcquiredTrigger(IOperableTrigger, CancellationToken)

Inform the IJobStore that the scheduler no longer plans to fire the given ITrigger, that it had previously acquired (reserved).

ValueTask ReleaseAcquiredTrigger(IOperableTrigger trigger, CancellationToken cancellationToken = default)

Parameters

trigger IOperableTrigger
cancellationToken CancellationToken

Returns

ValueTask

ReplaceTrigger(TriggerKey, IOperableTrigger, CancellationToken)

Remove (delete) the ITrigger with the given name, and store the new given one - which must be associated with the same job.

ValueTask<bool> ReplaceTrigger(TriggerKey triggerKey, IOperableTrigger trigger, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey

The ITrigger to be replaced.

trigger IOperableTrigger

The new ITrigger to be stored.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true if a ITrigger was stored under triggerKey and has been replaced by trigger.

RequestInterrupt(string, CancellationToken)

Records a request that a running firing be interrupted, on the firing's own record, for the node running it to act on.

ValueTask<bool> RequestInterrupt(string fireInstanceId, CancellationToken cancellationToken = default)

Parameters

fireInstanceId string

The firing, as FireInstanceId names it.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true when an executing firing with that id was found and the request recorded.

Remarks

A clustered store's way of reaching a firing on another node. The scheduler calls this from Interrupt(JobKey, CancellationToken) and InterruptFireInstance(string, CancellationToken), only when Clustered is true, for each executing firing it could not interrupt itself. The node running the firing reads its requests through GetInterruptRequests(CancellationToken) and cancels the job's token as a local interrupt does. A request is not an error when the firing has completed: there is nothing to record it on, and the answer is false.

A default interface member, added in 4.6. The default records nothing and answers false, so that store's interrupts stay with the node they are asked of.

ResetTriggerFromErrorState(TriggerKey, CancellationToken)

Reset the current state of the identified ITrigger from Error to Normal or Paused as appropriate.

ValueTask<bool> ResetTriggerFromErrorState(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey
cancellationToken CancellationToken

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.

See Also

ResetTriggersFromErrorState(IReadOnlyCollection<TriggerKey>, CancellationToken)

Reset every one of the identified ITriggers from Error to Normal or Paused as appropriate.

ValueTask<List<TriggerKey>> ResetTriggersFromErrorState(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)

Parameters

triggerKeys IReadOnlyCollection<TriggerKey>
cancellationToken CancellationToken

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 — the plural of the single-key bool, not a failure.

Remarks

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

ResumeAll(CancellationToken)

Resume (un-pause) all triggers - equivalent of calling ResumeTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) on every group.

If any ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.

ValueTask ResumeAll(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask
See Also

ResumeJob(JobKey, CancellationToken)

Resume (un-pause) the IJob with the given key.

If any of the IJob'sITrigger s missed one or more fire-times, then the ITrigger's misfire instruction will be applied.

ValueTask<bool> ResumeJob(JobKey jobKey, CancellationToken cancellationToken = default)

Parameters

jobKey JobKey
cancellationToken CancellationToken

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.

ResumeJobGroups(GroupMatcher<JobKey>, CancellationToken)

Resume (un-pause) the job groups that match, and the IJobs in them.

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.

ValueTask<List<string>> ResumeJobGroups(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<JobKey>
cancellationToken CancellationToken

Returns

ValueTask<List<string>>

The names of the job groups this call resumed.

ResumeJobs(IReadOnlyCollection<JobKey>, CancellationToken)

Resume (un-pause) the IJobs with the given keys.

ValueTask<List<JobKey>> ResumeJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)

Parameters

jobKeys IReadOnlyCollection<JobKey>
cancellationToken CancellationToken

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 — the plural of the single-key bool, not a failure.

Remarks

If any of the jobs' ITriggers missed one or more fire-times, then those triggers' misfire instructions will be applied.

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

ResumeTrigger(TriggerKey, CancellationToken)

Resume (un-pause) the ITrigger with the given key.

If the ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.

ValueTask<bool> ResumeTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey
cancellationToken CancellationToken

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.

ResumeTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken)

Resume (un-pause) the trigger groups that match, and every ITrigger in them.

If any ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.

ValueTask<List<string>> ResumeTriggerGroups(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)

Parameters

matcher GroupMatcher<TriggerKey>
cancellationToken CancellationToken

Returns

ValueTask<List<string>>

The names of the trigger groups this call resumed.

ResumeTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)

Resume (un-pause) the ITriggers with the given keys.

ValueTask<List<TriggerKey>> ResumeTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)

Parameters

triggerKeys IReadOnlyCollection<TriggerKey>
cancellationToken CancellationToken

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 — the plural of the single-key bool, not a failure.

Remarks

If a ITrigger missed one or more fire-times, then its misfire instruction will be applied.

The default implementation walks the set one key at a time. A store overrides it to do the walk inside a single lock or connection scope; the answer must not change when it does.

See Also

ScheduleJob(IJobDetail, IOperableTrigger, CancellationToken)

Store the given IJobDetail and ITrigger.

ValueTask ScheduleJob(IJobDetail job, IOperableTrigger trigger, CancellationToken cancellationToken = default)

Parameters

job IJobDetail

The IJobDetail to be stored.

trigger IOperableTrigger

The ITrigger to be stored.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Exceptions

ObjectAlreadyExistsException

A job or a trigger is already stored under one of the two keys. Nothing is stored.

ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<IOperableTrigger>>, ScheduleJobOptions, CancellationToken)

Store all the given jobs with their related triggers.

ValueTask ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<IOperableTrigger>> triggersAndJobs, ScheduleJobOptions options = default, CancellationToken cancellationToken = default)

Parameters

triggersAndJobs IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<IOperableTrigger>>

The jobs to store, each with the triggers that fire it. IOperableTrigger, like the rest of the store contract — the scheduler validates and downcasts the caller's triggers before they reach the store.

options ScheduleJobOptions

How to store them. Replace over-writes any job or trigger already stored under one of the same keys; without it, a key that exists throws ObjectAlreadyExistsException and none of the batch is stored. Paused stores every trigger paused; it reaches only a store that says SupportsStoringPaused.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Exceptions

ObjectAlreadyExistsException

A key in the batch is already stored and Replace was not asked for. None of the batch is stored.

SchedulerPaused(CancellationToken)

Called by the QuartzScheduler to inform the JobStore that the scheduler has been paused.

ValueTask SchedulerPaused(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask

SchedulerResumed(CancellationToken)

Called by the QuartzScheduler to inform the JobStore that the scheduler has resumed after being paused.

ValueTask SchedulerResumed(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask

SchedulerStarted(CancellationToken)

Called by the QuartzScheduler to inform the IJobStore that the scheduler has started.

ValueTask SchedulerStarted(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask

Shutdown(CancellationToken)

Called by the QuartzScheduler to inform the IJobStore that it should free up all of its resources because the scheduler is shutting down.

ValueTask Shutdown(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask

StoreTrigger(IOperableTrigger, TriggerConflict, CancellationToken)

Store the given trigger, deciding what becomes of one already stored under its key, and say which it was.

ValueTask<ScheduleTriggerResult> StoreTrigger(IOperableTrigger trigger, TriggerConflict onConflict, CancellationToken cancellationToken = default)

Parameters

trigger IOperableTrigger

The trigger to store, its first fire time already computed.

onConflict TriggerConflict

What to do when a trigger is stored under the same key.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<ScheduleTriggerResult>

Whether the trigger was created, stored over another or not stored, and when the stored trigger fires next.

Remarks

The decision and the write are one operation under the store's lock, so of two callers storing the same key with Keep exactly one creates the trigger and the other is told it was kept. Keep and KeepEarlier keep only a trigger with a fire time still ahead of it.

A default interface member, so a store written against an earlier 4.x keeps working. The default reads the existing trigger with GetTrigger(TriggerKey, CancellationToken) and writes with AddTrigger(IOperableTrigger, AddTriggerOptions, CancellationToken): correct, and not atomic. A new name rather than an overload of AddTrigger(IOperableTrigger, AddTriggerOptions, CancellationToken), because PublicApiGenerator marks default implementations per method name.

Exceptions

ObjectAlreadyExistsException

A trigger is already stored under the same key and onConflict is Throw.

TriggeredJobComplete(IOperableTrigger, IJobDetail, SchedulerInstruction, CancellationToken)

Inform the IJobStore that the scheduler has completed the firing of the given ITrigger (and the execution its associated IJob), and that the JobDataMap in the given IJobDetail should be updated if the IJob is stateful.

ValueTask TriggeredJobComplete(IOperableTrigger trigger, IJobDetail jobDetail, SchedulerInstruction triggerInstructionCode, CancellationToken cancellationToken = default)

Parameters

trigger IOperableTrigger
jobDetail IJobDetail
triggerInstructionCode SchedulerInstruction
cancellationToken CancellationToken

Returns

ValueTask

TriggersFired(IReadOnlyCollection<IOperableTrigger>, CancellationToken)

Inform the IJobStore that the scheduler is now firing the given ITrigger (executing its associated IJob), that it had previously acquired (reserved).

ValueTask<List<TriggerFiredResult>> TriggersFired(IReadOnlyCollection<IOperableTrigger> triggers, CancellationToken cancellationToken = default)

Parameters

triggers IReadOnlyCollection<IOperableTrigger>
cancellationToken CancellationToken

Returns

ValueTask<List<TriggerFiredResult>>

May return null if all the triggers or their calendars no longer exist, or if the trigger was not successfully put into the 'executing' state. Preference is to return an empty list if none of the triggers could be fired.

UpdateFireInstanceProgress(string, FireInstanceProgress, CancellationToken)

Records what a running firing last reported about how far it has got, so that QueryFireInstances(FireInstanceQuery, CancellationToken) answers it on Progress and ProgressMessage.

ValueTask UpdateFireInstanceProgress(string fireInstanceId, FireInstanceProgress progress, CancellationToken cancellationToken = default)

Parameters

fireInstanceId string

The firing, as FireInstanceId names it.

progress FireInstanceProgress

What the firing reported.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask

Remarks

The scheduler calls this at most once a second per firing, only when the value has changed, off the job's own flow and never awaited by it: a failure is logged and the job carries on. The firing is this node's own, so a store needs no scheduler-wide lock to write it. A fire instance that has already completed is not an error — the write simply finds nothing to update.

A default interface member, so a store written against an earlier 4.x keeps working. The default records nothing, and that store's firings report no progress.

UpdateTriggerDetails(TriggerKey, TriggerDetailsUpdate, CancellationToken)

Updates trigger metadata and selected settings without deleting/recreating the trigger and without resetting fire times or trigger state.

ValueTask<bool> UpdateTriggerDetails(TriggerKey triggerKey, TriggerDetailsUpdate update, CancellationToken cancellationToken = default)

Parameters

triggerKey TriggerKey

The key identifying the trigger to update.

update TriggerDetailsUpdate

The details to update. Only properties explicitly set will be changed. May include the calendar name and the misfire instruction, which can affect firing behavior.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<bool>

true if the trigger was found and updated, false if not found.

See Also