Method RecordAsync
- Namespace
- MailFathom.Application.Spam.Actions
- Assembly
- MailFathom.Application.dll
RecordAsync(SpamClassification, SpamActionPosture, CancellationToken)
Asks for whatever the switches say should happen to one classified message.
public Task<SpamActionResult> RecordAsync(SpamClassification classification, SpamActionPosture posture, CancellationToken cancellationToken)
Parameters
classificationSpamClassificationWhat classification concluded about the occurrence.
postureSpamActionPostureWhether the changes are written down or only worked out.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<SpamActionResult>
The changes that were written down, what a dry run would have written down, or the reason there were none.
Remarks
The checks run in the order of what they cost and of what they settle. Whether anything is switched on at all is free and answers for the whole deployment; the verdict and the threshold are already in hand; only then is the mailbox read. A deployment that asked for no action therefore performs one property read per classified message and nothing else.
The posture is read last of all, after every one of those checks. That is what makes a dry run a rehearsal rather than a prediction: a message a filing would be refused for reports the refusal in both postures, so an operator reading a dry run is reading the answers the acting run would reach and not a shorter list of them.
Exceptions
- ArgumentNullException
Thrown when
classificationis null.- ArgumentOutOfRangeException
Thrown when
postureis not a defined member.- PersistenceConcurrencyConflictException
Thrown when every allowed commit attempt conflicted.