Method CreateAvailableAt
- Namespace
- MailFathom.Application.Jobs
- Assembly
- MailFathom.Application.dll
CreateAvailableAt(JobIdempotencyKey, IJobPayload, MailAccountId?, DateTimeOffset)
States an execution to be done no earlier than a given instant.
public static JobEnqueueRequest CreateAvailableAt(JobIdempotencyKey key, IJobPayload payload, MailAccountId? accountId, DateTimeOffset availableAt)
Parameters
keyJobIdempotencyKeyThe identity of the execution, composed by whoever knows the work.
payloadIJobPayloadThe references the work is described by.
accountIdMailAccountId?The account the work belongs to, or null when it belongs to none.
availableAtDateTimeOffsetThe instant before which no worker may claim the job.
Returns
- JobEnqueueRequest
The request to enqueue.
Remarks
An instant already past is accepted and means the same as none: the claim compares the column against the database's clock, so a job is never made unclaimable by having been scheduled late.
Exceptions
- ArgumentNullException
Thrown when
keyorpayloadis null.- ArgumentException
Thrown when the payload names no declared job type.