Table of Contents

Method GetEmailsAwaitingEnrichmentAsync

Namespace
MailFathom.Application.Emails.Enrichment
Assembly
MailFathom.Application.dll

GetEmailsAwaitingEnrichmentAsync(MailAccountId, int, int, CancellationToken)

Reads one bounded batch of the account's mail that is ready to be derived from and has not been.

Task<IReadOnlyList<EnrichableEmail>> GetEmailsAwaitingEnrichmentAsync(MailAccountId account, int batchSize, int maximumPassagesPerEmail, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account whose mail is walked.

batchSize int

How many messages the batch may hold.

maximumPassagesPerEmail int

How many of each message's leading passages travel with it.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<EnrichableEmail>>

The messages, ordered by their identifier, each carrying the passages a derivation reads.

Remarks

The passages travel with the batch rather than being fetched per message, because the batch is small by construction — one derivation is one provider call — and a second query per message would cost a round trip to save nothing.

Exceptions

ArgumentOutOfRangeException

Thrown when either bound is below one.