Table of Contents

Class HeldSendDispatchHandler

Namespace
MailFathom.Application.Mail.Delivery.Scheduling
Assembly
MailFathom.Application.dll

Tells an account's outbox that a message it has been holding is now due to leave.

public sealed class HeldSendDispatchHandler : IJobHandler
Inheritance
HeldSendDispatchHandler
Implements
Inherited Members

Remarks

The job is deliberately short, and it transmits nothing. The message was written down when it was authored and has been unclaimable ever since, because the instant it may next be claimed at is the instant it was written to leave at; what was missing was somebody to notice that instant arriving. That is what the durable queue already does for every other kind of deferred work, so a held send needs a job rather than a timer, a scheduler, or a queue of its own.

A send that was cancelled while it was held, or one an earlier pass has already taken, is not signalled. The pass would find nothing to claim either way, so this is about what an operator reads rather than about correctness: a job that signalled an account for a message nobody is waiting for would report work that was not there.

Running it twice with one payload is the same as running it once. A signal is a request for a pass over an account, the pass reads the outbox rather than this job, and an account already waiting for one is not queued twice.

Nothing here decides whether the message is still timely. That belongs to the pass, which holds the lease the decision has to be recorded under, and which reaches the same decision for a message this job never ran for — because the deployment was down when it came due, or because the queue was full when it was written.

Constructors

HeldSendDispatchHandler(IOutgoingEmailStore, MailOutboxSignal)

Initializes the handler from the record it reads and the loop it wakes.

Properties

JobType

Gets the job type this handler runs, which is also the contract its payload arrives under.

Methods

RunAsync(IJobPayload, CancellationToken)

Runs the work the payload describes.