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
jobIdJobIdThe job to dead-letter.
ownerJobLeaseOwnerThe attempt claiming to hold it.
failureJobFailureRecordWhat ended the job, which is what an operator reads when they ask why it stopped.
cancellationTokenCancellationTokenCancels 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
ownerorfailureis null.