Method GetEmailsAwaitingAttachmentTextAsync
- Namespace
- MailFathom.Application.Emails.AttachmentText
- Assembly
- MailFathom.Application.dll
GetEmailsAwaitingAttachmentTextAsync(MailAccountId, StoredEmailId?, int, CancellationToken)
Reads a bounded batch of the account's mail whose attachments nothing has read yet.
Task<IReadOnlyList<EmailAwaitingAttachmentText>> GetEmailsAwaitingAttachmentTextAsync(MailAccountId account, StoredEmailId? resumeAfter, int batchSize, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account whose mail is walked.
resumeAfterStoredEmailId?The identity the previous batch of this walk reached, or null to start at the beginning.
batchSizeintThe greatest number of messages to return.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<EmailAwaitingAttachmentText>>
The messages in identity order, or an empty list when the account owes none past the resume position.
Remarks
The resume position exists for the messages a reading leaves unsettled rather than for the ones it settles, in the same way the rule queue's does. Most messages leave this selection by being read, but one whose stored copy needs fetching again, or whose picture a provider did not answer for, deliberately keeps no stamp — and without a cursor the next batch of the same pass would select exactly those messages again, derive them again, and never reach anything behind them. Mail carrying no attachment is never selected at all rather than being selected and stepped over, which is what keeps the walk proportional to the mail this feature is about.
Exceptions
- ArgumentOutOfRangeException
Thrown when
batchSizeis not positive.