Method CompleteAsync
- Namespace
- MailFathom.Application.Jobs
- Assembly
- MailFathom.Application.dll
CompleteAsync(JobId, JobLeaseOwner, CancellationToken)
Ends a held job as done, leaving a terminal row that keeps its key.
Task<bool> CompleteAsync(JobId jobId, JobLeaseOwner owner, CancellationToken cancellationToken)
Parameters
jobIdJobIdThe job to complete.
ownerJobLeaseOwnerThe attempt claiming to hold it.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<bool>
true when this attempt still held the job and the completion was written; otherwise false.
Remarks
Writing nothing is the point of the compare-and-set. Without it, an attempt that lost its lease and finished late would overwrite the outcome of the attempt that replaced it.
Exceptions
- ArgumentNullException
Thrown when
owneris null.