Method ClassifyAsync
- Namespace
- MailFathom.Application.Spam
- Assembly
- MailFathom.Application.dll
ClassifyAsync(StoredEmailId, SpamClassificationMode, CancellationToken)
Classifies one occurrence.
public Task<SpamClassificationResult> ClassifyAsync(StoredEmailId emailId, SpamClassificationMode mode, CancellationToken cancellationToken)
Parameters
emailIdStoredEmailIdThe occurrence to classify.
modeSpamClassificationModeWhat to do about an occurrence that already carries a classification.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<SpamClassificationResult>
What was recorded, or the reason nothing was.
Remarks
The order of the checks is the order of what they cost. Whether classification is on at all is free, the scope and the existing record are one lookup each, and only then is content read — so an occurrence outside the scope costs no read of its mail, which is the property that keeps a switched-off feature free.
Exceptions
- ArgumentOutOfRangeException
Thrown when
modeis not a defined member.- PersistenceConcurrencyConflictException
Thrown when every allowed commit attempt conflicted.