Class DerivedWorkGate
- Namespace
- MailFathom.Application.Spam.Gating
- Assembly
- MailFathom.Application.dll
Decides whether the work derived from a message may run yet, from where the message is and what was decided about it.
public sealed class DerivedWorkGate
- Inheritance
-
DerivedWorkGate
- Inherited Members
Remarks
Nothing expensive happens to a message before it is known not to be junk, and nothing expensive happens to it at all if it is. That is the whole of the mechanism: chunking, embedding, and rule evaluation are ordered behind classification rather than compensated for afterwards, so a message on its way to the junk folder is never chunked, never embedded, and never offered to a rule — the work was not cancelled, it was never started.
The one failure mode it must not have is turning a wedged scanner into a silently dead index. A message that cannot be classified, and one that has waited longer than a verdict is allowed to take, are both released to derived work and counted as released; only a message genuinely still waiting is held, and only for as long as the wait permits.
It reads and never writes. No flag records that a message was withheld, which is what makes mail the user drags out of the junk folder ordinary mail from that moment: the next reading of the same four facts admits it, and the ordinary backfill picks it up.
Whether it reaches a message at all is that message's user's decision. The terms name the accounts of the users who classify, so a user who switched classification off has every one of their messages admitted while another user's mail goes on waiting on its verdict — and a walk that spans both applies each answer to the mail it is about.
Constructors
- DerivedWorkGate(ISpamClassificationSettingsReader, IDeploymentMailFolders, TimeProvider)
Initializes the gate from the decisions it obeys.
Methods
- Admit(DerivedWorkAdmissionTerms, DerivedWorkCandidate)
Decides what one occurrence's admission is under terms already read.
- ReadTermsAsync(CancellationToken)
Reads the terms in force now, as one snapshot a whole walk is decided under.