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 account, StoredEmailId? resumeAfter, int batchSize, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account whose arrival queue is read, by its generated identifier together.
resumeAfterStoredEmailId?The identity the previous batch of this walk reached, or null to start at the beginning.
batchSizeintHow many emails to read at most.
cancellationTokenCancellationTokenCancels 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.