Method RunAsync
- Namespace
- MailFathom.Application.Mail.Maintenance
- 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.
Remarks
A segment whose scope has no outstanding run does nothing at all. That is what a job outliving the run it was enqueued for looks like — an overlapping attempt reached the end of the scope first, or the operator's request was answered by a run that has since finished — and it is an outcome rather than a failure: the work the segment was for 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.