Table of Contents

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

session IPersistenceSession

The session the batch's evaluations and the run's position commit together in.

storedEmailIds IReadOnlyList<StoredEmailId>

The emails the batch evaluated, which excludes every email it skipped.

evaluatedAt DateTimeOffset

When the pass evaluated them.

cancellationToken CancellationToken

Cancels 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.