Method RecordAsync
- Namespace
- MailFathom.Application.Spam.Actions
- Assembly
- MailFathom.Application.dll
RecordAsync(SpamClassification, SpamActionPosture, CancellationToken)
Asks for whatever the account's 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. The verdict is already in hand and answers first, because it is free and refuses most messages; the occurrence is then read, because the switches are the account's and the occurrence is what names it; the threshold and the mailbox follow. A message nothing concluded junk about therefore costs no read at all, and one that is junk in a mailbox that asked for no action costs the occurrence row 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.