Class RAMJobStore
This class implements a IJobStore that utilizes RAM as its storage device.
As you should know, the ramification of this is that access is extremely fast, but the data is completely volatile - therefore this IJobStore should not be used if true persistence between program shutdowns is required.
public sealed class RAMJobStore : IJobStore
- Inheritance
-
RAMJobStore
- Implements
- Inherited Members
Constructors
RAMJobStore(ILoggerFactory, ISchedulerSignaler, TimeProvider)
Initializes a new instance of the RAMJobStore class.
public RAMJobStore(ILoggerFactory loggerFactory, ISchedulerSignaler signaler, TimeProvider timeProvider)
Parameters
loggerFactoryILoggerFactorysignalerISchedulerSignalertimeProviderTimeProvider
Properties
Clustered
Whether the IJobStore implementation is clustered.
public bool Clustered { get; }
Property Value
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.
public TimeSpan EstimatedTimeToReleaseAndAcquireTrigger { get; }
Property Value
MisfireThreshold
Gets or sets the time by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied.
[TimeSpanParseRule(TimeSpanParseRule.Milliseconds)]
public TimeSpan MisfireThreshold { get; }
Property Value
- TimeSpan
The time by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied. The default is
5seconds.
Exceptions
- ArgumentException
valuerepresents less than one millisecond.
SupportsPersistence
Returns whether this instance supports persistence.
public bool SupportsPersistence { get; }
Property Value
Methods
AcquireNextTriggers(TriggerAcquisitionRequest, CancellationToken)
Get a handle to the next trigger to be fired, and mark it as 'reserved' by the calling scheduler.
public ValueTask<List<IOperableTrigger>> AcquireNextTriggers(TriggerAcquisitionRequest request, CancellationToken cancellationToken = default)
Parameters
requestTriggerAcquisitionRequestWhat to acquire: the cut-off time, how many, the batching window and the per-execution-group capacity still available.
cancellationTokenCancellationTokenThe 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).
- See Also
AddCalendar(string, ICalendar, AddCalendarOptions, CancellationToken)
Store the given ICalendar.
public ValueTask AddCalendar(string calendarName, ICalendar calendar, AddCalendarOptions options = default, CancellationToken cancellationToken = default)
Parameters
calendarNamestringThe name.
calendarICalendarThe ICalendar to be stored.
optionsAddCalendarOptionsWhether an existing calendar of the same name may be over-written, and whether the triggers referencing it have their next fire time re-computed.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
AddJob(IJobDetail, AddJobOptions, CancellationToken)
Store the given IJob.
public ValueTask AddJob(IJobDetail job, AddJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
jobIJobDetailThe IJob to be stored.
optionsAddJobOptionsHow to store it; see AddJob(IJobDetail, AddJobOptions, CancellationToken).
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
AddTrigger(IOperableTrigger, AddTriggerOptions, CancellationToken)
Store the given ITrigger.
public ValueTask AddTrigger(IOperableTrigger trigger, AddTriggerOptions options = default, CancellationToken cancellationToken = default)
Parameters
triggerIOperableTriggerThe ITrigger to be stored.
optionsAddTriggerOptionsHow to store it; see AddTrigger(IOperableTrigger, AddTriggerOptions, CancellationToken).
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Clear(CancellationToken)
public ValueTask Clear(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
DeleteCalendar(string, CancellationToken)
Remove (delete) the ICalendar with the given name.
If removal of the ICalendar would result in ITriggers pointing to non-existent calendars, then a JobPersistenceException will be thrown.
public ValueTask<bool> DeleteCalendar(string calendarName, CancellationToken cancellationToken = default)
Parameters
calendarNamestringThe name of the ICalendar to be removed.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
DeleteJob(JobKey, CancellationToken)
public ValueTask<bool> DeleteJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
DeleteJobs(GroupMatcher<JobKey>, CancellationToken)
Deletes the jobs in the matching groups, resolving the keys under the same lock that removes them so that a job stored meanwhile cannot slip through the gap.
public ValueTask<List<JobKey>> DeleteJobs(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<JobKey>cancellationTokenCancellationToken
Returns
DeleteJobs(IReadOnlyCollection<JobKey>, CancellationToken)
public ValueTask<List<JobKey>> DeleteJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>cancellationTokenCancellationToken
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 name.
public ValueTask<bool> DeleteTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
- ValueTask<bool>
true if a ITrigger with the given name and group was found and removed from the store.
DeleteTriggers(GroupMatcher<TriggerKey>, CancellationToken)
Deletes the jobs in the matching groups, resolving the keys under the same lock that removes them so that a job stored meanwhile cannot slip through the gap.
public ValueTask<List<TriggerKey>> DeleteTriggers(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<TriggerKey>cancellationTokenCancellationToken
Returns
DeleteTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
Remove (delete) the ITriggers with the given keys.
public ValueTask<List<TriggerKey>> DeleteTriggers(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 — 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.
public ValueTask<bool> Exists(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeythe identifier to check for
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
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
triggerKeyTriggerKeytriggerKey the identifier to check for
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Exists(string, CancellationToken)
Determine whether an ICalendar with the given name already exists within the store.
public ValueTask<bool> Exists(string calendarName, CancellationToken cancellationToken = default)
Parameters
calendarNamestringthe name to check for
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
GetAcquireRetryDelay(int)
Get the amount of time to wait when accessing this job store repeatedly fails.
public TimeSpan GetAcquireRetryDelay(int failureCount)
Parameters
failureCountintthe 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 ITrigger.
public ValueTask<ICalendar?> GetCalendar(string calendarName, CancellationToken cancellationToken = default)
Parameters
calendarNamestringThe name of the ICalendar to be retrieved.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
GetJob(JobKey, CancellationToken)
Retrieve the IJobDetail for the given IJob.
public ValueTask<IJobDetail?> GetJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
- ValueTask<IJobDetail>
The desired IJob, or null if there is no match.
GetJobs(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>> GetJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>The keys of the jobs to retrieve.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
GetTrigger(TriggerKey, CancellationToken)
Retrieve the given ITrigger.
public ValueTask<IOperableTrigger?> GetTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
- ValueTask<IOperableTrigger>
The desired ITrigger, or null if there is no match.
GetTriggerState(TriggerKey, CancellationToken)
Get the current state of the identified ITrigger.
public ValueTask<TriggerState> GetTriggerState(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
- 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<IOperableTrigger>> GetTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>The keys of the triggers to retrieve.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
GetTriggersForJob(JobKey, CancellationToken)
Get all the Triggers that are associated to the given Job.
If there are no matches, a zero-length array should be returned.
public ValueTask<List<IOperableTrigger>> GetTriggersForJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
Initialize(SchedulerIdentity, CancellationToken)
Called by the QuartzScheduler before the IJobStore is used, in order to give it a chance to Initialize.
public ValueTask Initialize(SchedulerIdentity identity, CancellationToken cancellationToken = default)
Parameters
identitySchedulerIdentitycancellationTokenCancellationToken
Returns
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.
public ValueTask PauseAll(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
- See Also
PauseJob(JobKey, CancellationToken)
Pause the IJobDetail with the given name - by pausing all of its current ITriggers.
public ValueTask<bool> PauseJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
PauseJobGroups(GroupMatcher<JobKey>, CancellationToken)
Pause all of the IJobDetails in the given group - by pausing all of their ITriggers.
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.
public ValueTask<List<string>> PauseJobGroups(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<JobKey>cancellationTokenCancellationToken
Returns
PauseJobs(IReadOnlyCollection<JobKey>, CancellationToken)
Pauses the whole set inside one lock pass rather than taking the lock per key.
public ValueTask<List<JobKey>> PauseJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>cancellationTokenCancellationToken
Returns
PauseTrigger(TriggerKey, CancellationToken)
Pause the ITrigger with the given name.
public ValueTask<bool> PauseTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
PauseTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken)
Pause all of the ITriggers in the given group.
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.
public ValueTask<List<string>> PauseTriggerGroups(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<TriggerKey>cancellationTokenCancellationToken
Returns
PauseTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
Pauses the whole set inside one lock pass rather than taking the lock per key.
public ValueTask<List<TriggerKey>> PauseTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
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
QueryClusterNodes(CancellationToken)
Lists the scheduler nodes this store knows about, as ClusterNodes: the current node first, then the rest by instance id (ordinal).
public ValueTask<List<ClusterNode>> QueryClusterNodes(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
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).
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
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).
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
QueryJobs(JobQuery, CancellationToken)
Lists jobs matching the query, as JobHeaders, ordered by group and then name (ordinal).
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
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).
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
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).
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
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).
public ValueTask ReleaseAcquiredTrigger(IOperableTrigger trigger, CancellationToken cancellationToken = default)
Parameters
triggerIOperableTriggercancellationTokenCancellationToken
Returns
ReplaceTrigger(TriggerKey, IOperableTrigger, CancellationToken)
Replaces one trigger with another for the same job, keeping the job and every other trigger of it as they are.
public ValueTask<bool> ReplaceTrigger(TriggerKey triggerKey, IOperableTrigger trigger, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeyThe TriggerKey of the ITrigger to be replaced.
triggerIOperableTriggerThe new trigger.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
The replacement must name the same job: a trigger that pointed somewhere else would move work from one job to another under a call that says it is replacing a schedule. A trigger that was paused stays paused, and one that was blocked is re-evaluated against the job's current state.
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.
- See Also
ResetTriggersFromErrorState(IReadOnlyCollection<TriggerKey>, CancellationToken)
Resets the whole set inside one lock pass rather than taking the lock per key.
public ValueTask<List<TriggerKey>> ResetTriggersFromErrorState(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
ResumeAll(CancellationToken)
Resume (un-pause) all triggers - equivalent of calling ResumeTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken) on every trigger group and setting all job groups unpaused />.
If any ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
public ValueTask ResumeAll(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
- See Also
ResumeJob(JobKey, CancellationToken)
Resume (un-pause) the IJobDetail with the given name.
If any of the IJob'sITrigger s missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
public ValueTask<bool> ResumeJob(JobKey jobKey, CancellationToken cancellationToken = default)
Parameters
jobKeyJobKeycancellationTokenCancellationToken
Returns
ResumeJobGroups(GroupMatcher<JobKey>, CancellationToken)
Resume (un-pause) all of the IJobDetails in the given group.
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.
public ValueTask<List<string>> ResumeJobGroups(GroupMatcher<JobKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<JobKey>cancellationTokenCancellationToken
Returns
ResumeJobs(IReadOnlyCollection<JobKey>, CancellationToken)
Resumes the whole set inside one lock pass rather than taking the lock per key.
public ValueTask<List<JobKey>> ResumeJobs(IReadOnlyCollection<JobKey> jobKeys, CancellationToken cancellationToken = default)
Parameters
jobKeysIReadOnlyCollection<JobKey>cancellationTokenCancellationToken
Returns
ResumeTrigger(TriggerKey, CancellationToken)
Resume (un-pause) the ITrigger with the given key.
public ValueTask<bool> ResumeTrigger(TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeycancellationTokenCancellationToken
Returns
Remarks
If the ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
ResumeTriggerGroups(GroupMatcher<TriggerKey>, CancellationToken)
Resume (un-pause) all of the ITriggers in the given group.
If any ITrigger missed one or more fire-times, then the ITrigger's misfire instruction will be applied.
public ValueTask<List<string>> ResumeTriggerGroups(GroupMatcher<TriggerKey> matcher, CancellationToken cancellationToken = default)
Parameters
matcherGroupMatcher<TriggerKey>cancellationTokenCancellationToken
Returns
ResumeTriggers(IReadOnlyCollection<TriggerKey>, CancellationToken)
Resumes the whole set inside one lock pass rather than taking the lock per key.
public ValueTask<List<TriggerKey>> ResumeTriggers(IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
triggerKeysIReadOnlyCollection<TriggerKey>cancellationTokenCancellationToken
Returns
ScheduleJob(IJobDetail, IOperableTrigger, CancellationToken)
Store the given IJobDetail and ITrigger.
public ValueTask ScheduleJob(IJobDetail job, IOperableTrigger trigger, CancellationToken cancellationToken = default)
Parameters
jobIJobDetailThe IJobDetail to be stored.
triggerIOperableTriggerThe ITrigger to be stored.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<IOperableTrigger>>, ScheduleJobOptions, CancellationToken)
Store all the given jobs with their related triggers.
public ValueTask ScheduleJobs(IReadOnlyDictionary<IJobDetail, IReadOnlyCollection<IOperableTrigger>> triggersAndJobs, ScheduleJobOptions options = default, CancellationToken cancellationToken = default)
Parameters
triggersAndJobsIReadOnlyDictionary<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.
optionsScheduleJobOptionsHow 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.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
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.
public ValueTask SchedulerPaused(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
SchedulerResumed(CancellationToken)
Called by the QuartzScheduler to inform the JobStore that the scheduler has resumed after being paused.
public ValueTask SchedulerResumed(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
SchedulerStarted(CancellationToken)
Called by the QuartzScheduler to inform the IJobStore that the scheduler has started.
public ValueTask SchedulerStarted(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
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.
public ValueTask Shutdown(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
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.
public ValueTask TriggeredJobComplete(IOperableTrigger trigger, IJobDetail jobDetail, SchedulerInstruction triggerInstructionCode, CancellationToken cancellationToken = default)
Parameters
triggerIOperableTriggerjobDetailIJobDetailtriggerInstructionCodeSchedulerInstructioncancellationTokenCancellationToken
Returns
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).
public ValueTask<List<TriggerFiredResult>> TriggersFired(IReadOnlyCollection<IOperableTrigger> triggers, CancellationToken cancellationToken = default)
Parameters
triggersIReadOnlyCollection<IOperableTrigger>cancellationTokenCancellationToken
Returns
UpdateTriggerDetails(TriggerKey, TriggerDetailsUpdate, CancellationToken)
Updates trigger metadata and selected settings without deleting/recreating the trigger and without resetting fire times or trigger state.
public ValueTask<bool> UpdateTriggerDetails(TriggerKey triggerKey, TriggerDetailsUpdate update, CancellationToken cancellationToken = default)
Parameters
triggerKeyTriggerKeyThe key identifying the trigger to update.
updateTriggerDetailsUpdateThe details to update. Only properties explicitly set will be changed. May include the calendar name and the misfire instruction, which can affect firing behavior.
cancellationTokenCancellationTokenThe cancellation instruction.