Method ExecuteAsync
- Namespace
- MailFathom.Application.Jobs.Execution
- Assembly
- MailFathom.Application.dll
ExecuteAsync(LeasedJob, CancellationToken)
Runs one job this process holds a lease on, and records the outcome against it.
public Task<JobExecutionResult> ExecuteAsync(LeasedJob job, CancellationToken stoppingToken)
Parameters
jobLeasedJobThe job this attempt holds.
stoppingTokenCancellationTokenCancels the work because the host is stopping; the job is then released rather than failed.
Returns
- Task<JobExecutionResult>
What the attempt did, in terms that carry no mail content.
Remarks
A job dispatched while the host is already stopping is released without being started, which is what a batch claimed just before a shutdown needs: the jobs behind the one that was running are handed back too, rather than waiting out a lease nobody is holding.
Exceptions
- ArgumentNullException
Thrown when
jobis null.