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
kindEmailContentKindThe payload kind to read, which decides the table.
resumeAfterGuid?The identity to continue past, or null to start at the beginning of the kind.
batchSizeintThe greatest number of payloads to name.
cancellationTokenCancellationTokenPropagates 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.