IJobScheduleStore
AgentPrism.Abstractions.dllThe store for schedule definitions.
public interface IJobScheduleStoreRemarks
Section titled “Remarks”Separate from IJobStore: this store holds only the definitions (when, what runs); the actual queued jobs are in IJobStore. The split is the same as between IWorkflowDefinitionStore and IWorkflowCheckpointStore.
Methods
Section titled “Methods”DeleteAsync(string, string, CancellationToken)
Section titled “ DeleteAsync(string, string, CancellationToken)”Deletes the schedule.
ValueTask<bool> DeleteAsync(string tenantId, string name, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
name string
The schedule name.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true if the delete happened.
GetAsync(string, string, CancellationToken)
Section titled “ GetAsync(string, string, CancellationToken)”Fetches the schedule with the given name.
ValueTask<JobSchedule?> GetAsync(string tenantId, string name, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
name string
The schedule name.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The schedule; null if it does not exist.
ListAsync(string, CancellationToken)
Section titled “ ListAsync(string, CancellationToken)”Lists all of a tenant’s schedules, by name.
ValueTask<IReadOnlyList<JobSchedule>> ListAsync(string tenantId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<JobSchedule>>
The schedules.
ListDueAsync(DateTimeOffset, CancellationToken)
Section titled “ ListDueAsync(DateTimeOffset, CancellationToken)”Lists the schedules of every tenant that are due to run
(NextRunAt <= asOfUtc), enabled, and carry a cron expression.
ValueTask<IReadOnlyList<JobSchedule>> ListDueAsync(DateTimeOffset asOfUtc, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”asOfUtc DateTimeOffset
The comparison moment (UTC).
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<JobSchedule>>
The due schedules.
SaveAsync(JobSchedule, CancellationToken)
Section titled “ SaveAsync(JobSchedule, CancellationToken)”Creates or updates the schedule (name + tenant is unique).
ValueTask<JobSchedule> SaveAsync(JobSchedule schedule, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”schedule JobSchedule
The schedule to save.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The saved schedule.
TryClaimNextRunAsync(Guid, DateTimeOffset, DateTimeOffset, DateTimeOffset, CancellationToken)
Section titled “ TryClaimNextRunAsync(Guid, DateTimeOffset, DateTimeOffset, DateTimeOffset, CancellationToken)”Tries to atomically advance a schedule’s JobSchedule.NextRunAt field (compare-and-swap).
ValueTask<bool> TryClaimNextRunAsync(Guid scheduleId, DateTimeOffset expectedNextRunAt, DateTimeOffset newNextRunAt, DateTimeOffset ranAt, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”scheduleId Guid
The schedule identifier.
expectedNextRunAt DateTimeOffset
The expected current value. If another instance has already advanced it, the value does not match and the operation fails — this is how two overlapping scheduling triggers are prevented.
newNextRunAt DateTimeOffset
The new next-run time.
ranAt DateTimeOffset
The time this trigger happened (UTC).
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true if the claim succeeded.