Table of Contents

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

classification SpamClassification

What classification concluded about the occurrence.

posture SpamActionPosture

Whether the changes are written down or only worked out.

cancellationToken CancellationToken

Propagates 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 classification is null.

ArgumentOutOfRangeException

Thrown when posture is not a defined member.

PersistenceConcurrencyConflictException

Thrown when every allowed commit attempt conflicted.