Class MailDraftPass
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
Keeps one account's drafts folder in step with the drafts this deployment holds.
public sealed class MailDraftPass
- Inheritance
-
MailDraftPass
- Inherited Members
Remarks
Saving, revising, and discarding a draft each act on the mailbox where they are asked for, so what is left for a pass is the half nobody is standing there for: a process that stopped between the two commands of a replacement, a mail server that was briefly unreachable, and a promoted draft whose message has since been delivered. Each of those is a draft the record already describes exactly, which is why the pass reads the record rather than the folder.
It runs where the outbox pass runs, which is both what a signal wakes and what an account's own synchronization run drains. That is the guarantee resuming rests on: whatever is outstanding is reached again on every run, so nothing has to remember that a process died mid-replacement.
An account whose drafts are all settled costs one bounded query. The read answers only drafts that owe the mail server something, so a deployment nobody drafts in spends nothing per pass.
Constructors
- MailDraftPass(IMailDraftStore, IOutgoingEmailStore, MailDraftFiler, OptimisticConcurrencyRetryPolicy, TimeProvider, MailOutboxSettings)
Initializes the pass from the drafts it reads and the filer it acts through.
Methods
- SettleOutstandingAsync(MailAccountId, CancellationToken)
Settles every draft of one account that still owes the mail server something.
- SettlePromotedAsync(OutgoingEmailId, CancellationToken)
Gives up the draft one delivered send was promoted from, and takes its copy out of the folder.