Table of Contents

Method ReadPageAsync

Namespace
MailFathom.Application.Emails.Summaries
Assembly
MailFathom.Application.dll

ReadPageAsync(EmailTimelineFilter, EmailTimelinePosition?, int, CancellationToken)

Reads the emails a filter selects, beginning after a known timeline position.

Task<IReadOnlyList<EmailSummary>> ReadPageAsync(EmailTimelineFilter filter, EmailTimelinePosition? continueAfter, int limit, CancellationToken cancellationToken)

Parameters

filter EmailTimelineFilter

Which emails to return and from which end of the timeline to read them.

continueAfter EmailTimelinePosition?

The position the previous page ended on, or null to start at the filter's leading end.

limit int

The greatest number of rows to return, at least one.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<IReadOnlyList<EmailSummary>>

At most limit summaries, ordered by EmailTimelinePosition in the filter's direction and beginning strictly beyond continueAfter.

Remarks

The order is total, which is what makes paging over it contiguous: the caller may ask for the next page at any time, and every row falls on exactly one side of continueAfter even when several emails share a received timestamp or carry none. An implementation reproduces ComparerFor(EmailTimelineDirection) rather than an order that merely resembles it.

The filter's scope names the accounts to read, and a use case resolves them before it calls. A scope naming none reaches every account the store holds rows for, which includes accounts a deployment has stopped serving; nothing here re-derives which those are.

Exceptions

ArgumentNullException

Thrown when filter is null.

ArgumentOutOfRangeException

Thrown when limit is below one.