Class MailAccountRunSignal
- Namespace
- MailFathom.Application.Synchronization
- Assembly
- MailFathom.Application.dll
Ends an account's wait between synchronization runs, where something written here is waiting on that run.
public sealed class MailAccountRunSignal
- Inheritance
-
MailAccountRunSignal
- Inherited Members
Remarks
It exists because of latency and nothing else, exactly as the outbox's own signal does. A mailbox change somebody authored is written down durably, and the account's next run is what tells the mail server; that run is what makes the change correct, and it happens whether or not anything here is called. What it cannot do is happen promptly — the wait between runs is the configured interval, and where the account is watched in push mode that wait ends only when the mail *server* reports something, which a change authored here is not. So a message somebody deleted stayed under moving to trash until the interval was out.
A raise is therefore a hint rather than a queue entry: it is never awaited, never retried, and losing one delays a change rather than dropping it. Nothing carries what the change was, because the run reads the records.
A raise arriving while nothing is waiting is kept, which is the case that has to be right rather than a corner: the record is often written while the account is mid-run, and a raise dropped there would be a change waiting out the whole of the next interval. It is kept per account rather than per change, so a hundred messages filed at once bring one run forward instead of a hundred, and it is spent by whichever of the two answers it — the run already under way, at one of its own stage boundaries, or the wait that follows it. A raise never survives what answered it, which would be a run brought forward for work already done.
Methods
- BringForward(MailAccountId)
Says that an account has something written down that its next run should not wait an interval for.
- Register(MailAccountId, CancellationToken)
Registers the wait an account is about to make, so a raise can end it.
- TakeRaise(MailAccountId)
Takes a raise standing against an account, so a run already under way answers it instead of the next one.