Table of Contents

Method DeadLetterAsync

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

DeadLetterAsync(JobId, JobLeaseOwner, JobFailureRecord, CancellationToken)

Ends a held job as work nothing will attempt again, leaving a terminal row that keeps its key and its last failure.

Task<bool> DeadLetterAsync(JobId jobId, JobLeaseOwner owner, JobFailureRecord failure, CancellationToken cancellationToken)

Parameters

jobId JobId

The job to dead-letter.

owner JobLeaseOwner

The attempt claiming to hold it.

failure JobFailureRecord

What ended the job, which is what an operator reads when they ask why it stopped.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<bool>

true when this attempt still held the job and the dead letter was written; otherwise false.

Remarks

It is terminal for the reason DeadLettered states, and inert: no claim takes it, so one job that cannot succeed consumes no further attempts and delays nothing behind it. The row keeps its key, its attempt count, and the failure that ended it, so what an operator acts on survives the run that produced it.

Exceptions

ArgumentNullException

Thrown when owner or failure is null.