Method RunAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Scheduling
- Assembly
- MailFathom.Application.dll
RunAsync(IJobPayload, CancellationToken)
Runs the work the payload describes.
public Task RunAsync(IJobPayload payload, CancellationToken cancellationToken)
Parameters
payloadIJobPayloadThe references the work is described by, of the contract JobType names.
cancellationTokenCancellationTokenCancels the work at the execution timeout, at host shutdown, and when the lease is lost.
Returns
- Task
A task that completes when the work is done.
Exceptions
- OperationCanceledException
Thrown when the work observes cancellation and stops.
- ArgumentException
Thrown when the payload is not the contract this job type names.
- InvalidOperationException
Thrown when the declaration holds no draft to compose from, which is a stored payload that was damaged rather than an occasion to pass over.
- MailSubmissionRefusedException
Thrown when this occasion's message is one the deployment will not send, so the occasion reaches the queue's own failure path instead of being dropped.