Table of Contents

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

jobId JobId

The job to complete.

owner JobLeaseOwner

The attempt claiming to hold it.

cancellationToken CancellationToken

Cancels 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 owner is null.