Table of Contents

Method ReleaseAsync

Namespace
MailFathom.Application.Jobs
Assembly
MailFathom.Application.dll

ReleaseAsync(JobId, JobLeaseOwner, CancellationToken)

Gives a held job back unfinished, so it is claimable again at once.

Task<bool> ReleaseAsync(JobId jobId, JobLeaseOwner owner, CancellationToken cancellationToken)

Parameters

jobId JobId

The job to release.

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 release was written; otherwise false.

Remarks

It is what a shutdown does with work it was holding, and it is deliberately not a failure. The attempt the claim counted is given back with the job, because a deployment is not something the work did: a long job interrupted by a rolling restart would otherwise reach the attempt bound and be dead-lettered without ever having failed.

Exceptions

ArgumentNullException

Thrown when owner is null.