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
accountMailAccountIdThe account whose mail is walked.
batchSizeintHow many messages the batch may hold.
maximumPassagesPerEmailintHow many of each message's leading passages travel with it.
cancellationTokenCancellationTokenCancels 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.