Table of Contents

Method ScheduleRetryAsync

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

ScheduleRetryAsync(JobId, JobLeaseOwner, JobFailureRecord, DateTimeOffset, CancellationToken)

Gives a held job back after a transient failure, claimable again once the instant named has passed.

Task<bool> ScheduleRetryAsync(JobId jobId, JobLeaseOwner owner, JobFailureRecord failure, DateTimeOffset availableAt, CancellationToken cancellationToken)

Parameters

jobId JobId

The job to schedule another attempt for.

owner JobLeaseOwner

The attempt claiming to hold it.

failure JobFailureRecord

What this attempt failed with, which replaces whatever the previous one recorded.

availableAt DateTimeOffset

The instant before which no claim may take the job again.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<bool>

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

Remarks

The attempt stays counted, because it was handed out and spent: the count is what the attempt bound is read against, and a retry that gave it back would loop forever. Delaying the job rather than releasing it is what separates this from a shutdown — a job returned to the queue at once after failing would be taken again as fast as the queue can hand it out.

Exceptions

ArgumentNullException

Thrown when owner or failure is null.