Constructor ScheduledJob
- Namespace
- MailFathom.Application.Jobs.Scheduling
- Assembly
- MailFathom.Application.dll
ScheduledJob(JobScheduleId, IJobPayload, JobRecurrence, MailAccountId?)
One execution a deployment wants repeated, and the occasions it wants it on.
public ScheduledJob(JobScheduleId Id, IJobPayload Payload, JobRecurrence Recurrence, MailAccountId? AccountId = null)
Parameters
IdJobScheduleIdThe identity the schedule's durable state is keyed by.
PayloadIJobPayloadThe references the repeated work is described by, which also names its job type.
RecurrenceJobRecurrenceThe occasions the work is dispatched on.
AccountIdMailAccountId?The account the work belongs to, or null when it belongs to none.
Remarks
The payload is fixed for the life of the declaration rather than composed per occasion, because what a recurring dispatch repeats is one piece of work: the occasion decides when, and the identity of the execution is the schedule plus that instant. A payload that varied per occasion would be a different job type asking for a scheduler rather than a schedule.
Declared rather than stored. What the deployment's configuration says is the whole of which schedules exist, and the only durable state a schedule has is the occasion it last dispatched — which is state rather than settings, and lives where every other piece of state does.