Table of Contents

Interface IOutboxOperationStore

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

Reads an outbox as an operator sees it, and carries out the two decisions they can take about one send.

public interface IOutboxOperationStore

Remarks

Separate from IOutgoingEmailStore because the callers are separate, for the reason the dead-letter store is separate from the job store. That contract is the delivery attempt's, and every write on it names the lease the calling attempt holds; nothing here holds a lease, because an operator is not an attempt. Folding the two together would put an operator's decision behind a lease owner it would have to invent, and would widen the surface a worker sees to include writes no worker may make.

Both decisions are conditional on the record still being in the state the decision applies to, and on no live lease holding it. That is what makes them safe to repeat and safe to race: an operator acting on a listing a few minutes old, or two terminals acting together, produce one change and one refusal that says what happened instead — rather than a cancellation that lands while a worker is offering the message to a server.

Methods

CancelAsync(OutgoingEmailId, CancellationToken)

Withdraws one send that has not begun transmitting.

CountByStageAsync(MailAccountId?, CancellationToken)

Counts what stands at each stage of an outbox.

ReadPageAsync(OutboxQuery, CancellationToken)

Serves one bounded page of the sends this deployment has recorded.

RequeueAsync(OutgoingEmailId, bool, CancellationToken)

Puts one send back where the next delivery pass claims it, with its attempts given back.