Table of Contents

Method GetEmailsAwaitingFirstEvaluationAsync

Namespace
MailFathom.Application.Rules.Evaluation
Assembly
MailFathom.Application.dll

GetEmailsAwaitingFirstEvaluationAsync(MailAccountId, StoredEmailId?, int, CancellationToken)

Reads the account's emails that no pass has evaluated, oldest identity first.

Task<IReadOnlyList<StoredEmailAwaitingRuleEvaluation>> GetEmailsAwaitingFirstEvaluationAsync(MailAccountId accountId, StoredEmailId? resumeAfter, int batchSize, CancellationToken cancellationToken)

Parameters

accountId MailAccountId

The account whose arrival queue is read.

resumeAfter StoredEmailId?

The identity the previous batch of this walk reached, or null to start at the beginning.

batchSize int

How many emails to read at most.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<StoredEmailAwaitingRuleEvaluation>>

The candidates, which is empty once the queue is drained.

Remarks

The queue shrinks as the pass records evaluations, so a completed email never appears in a later batch. The resume position exists for the emails a pass skipped rather than evaluated: without it a batch whose head is waiting for extraction would be read again on the next batch and the walk would never move past it.