Method RunAsync
- Namespace
- MailFathom.Application.Jobs.Execution
- Assembly
- MailFathom.Application.dll
RunAsync(CancellationToken)
Claims one batch and runs it, reporting what each job did.
public Task<IReadOnlyList<JobExecutionResult>> RunAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationTokenCancels the claim, and stops each running job so its lease is given back.
Returns
- Task<IReadOnlyList<JobExecutionResult>>
One result per claimed job, in the order they were claimed, and an empty answer when nothing was due.
Remarks
Cancellation does not end the pass early. Every claimed job is still dispatched, because a job the runner finds already cancelled is released rather than run — which is how the jobs behind the ones that were running get their leases back instead of waiting out an expiry.