Table of Contents

Class MailOutboxSignal

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

Carries the news that an account has something to send, from whoever wrote it down to whoever delivers it.

public sealed class MailOutboxSignal
Inheritance
MailOutboxSignal
Inherited Members

Remarks

It exists because of latency and nothing else. Everything outstanding is already drained by the account's own synchronization run, which is what makes the outbox correct without this; what a run cannot do is leave promptly, and a message somebody authored — or a tool call that answered with a queued identifier — must not wait behind a mailbox scan. So this is the fast path and the run is the guarantee, which is why a signal that is never delivered delays a send rather than losing one.

The queue is bounded, and what it holds is accounts rather than messages. An account already signalled is not signalled again, so a hundred messages written at once produce one pass over that account's outbox instead of a hundred, and the depth cannot grow past the number of configured accounts however much is enqueued. That is the backpressure: a signal that finds the queue full is refused rather than queued, the caller is told so, and the account's next run picks the work up.

Writing to it never blocks and never waits, because the caller is finishing an authored send: making an operator's tool call wait on a background queue would turn a bounded queue into a bounded API.

Constructors

MailOutboxSignal(int)

Creates the queue at the depth this deployment allows it.

Properties

Depth

Gets how many accounts are waiting for a pass.

Methods

ReadAllAsync(CancellationToken)

Reads the accounts to take a pass over, as they are signalled.

Signal(MailAccountId)

Says that an account has something outstanding to deliver.