Method RecordEvaluatedAsync
- Namespace
- MailFathom.Application.Rules.Evaluation
- Assembly
- MailFathom.Application.dll
RecordEvaluatedAsync(IPersistenceSession, IReadOnlyList<StoredEmailId>, DateTimeOffset, CancellationToken)
Records that a rule set has been evaluated for each of these emails.
Task RecordEvaluatedAsync(IPersistenceSession session, IReadOnlyList<StoredEmailId> storedEmailIds, DateTimeOffset evaluatedAt, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the batch's evaluations and the run's position commit together in.
storedEmailIdsIReadOnlyList<StoredEmailId>The emails the batch evaluated, which excludes every email it skipped.
evaluatedAtDateTimeOffsetWhen the pass evaluated them.
cancellationTokenCancellationTokenCancels the staging.
Returns
- Task
A task that completes once the writes are staged in the session.
Remarks
This is what takes an email out of the arrival queue, and therefore what makes a rule apply to mail arriving from now on rather than to a mailbox's whole history. An email the pass skipped is deliberately left out, so it returns to the queue's head and is evaluated once whatever it was waiting for has arrived.