Table of Contents

Method GetPayloadsToMoveAsync

Namespace
MailFathom.Application.EmailContent.Move
Assembly
MailFathom.Application.dll

GetPayloadsToMoveAsync(EmailContentKind, Guid?, int, CancellationToken)

Reads the next bounded batch of payloads of one kind that the database still holds.

Task<IReadOnlyList<DatabaseBackedPayload>> GetPayloadsToMoveAsync(EmailContentKind kind, Guid? resumeAfter, int batchSize, CancellationToken cancellationToken)

Parameters

kind EmailContentKind

The payload kind to read, which decides the table.

resumeAfter Guid?

The identity to continue past, or null to start at the beginning of the kind.

batchSize int

The greatest number of payloads to name.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<IReadOnlyList<DatabaseBackedPayload>>

The payloads, ordered by the identity the resume position is expressed in, and never more than batchSize.

Remarks

Only rows the database still holds are named, so a payload the move has already carried leaves the walk's own set. The resume position is what carries the walk past a payload it could not move, which would otherwise be named again on every batch and stand in front of everything behind it forever.