Table of Contents

Method ReadAsync

Namespace
MailFathom.Application.Mail.Mutations
Assembly
MailFathom.Application.dll

ReadAsync(IReadOnlyList<MailAccountId>, IReadOnlyList<MailboxMutationRecordId>, CancellationToken)

Reads the records a change on the caller's own accounts carries, by the identities that change was answered with.

Task<IReadOnlyList<MailboxMutationRecord>> ReadAsync(IReadOnlyList<MailAccountId> accounts, IReadOnlyList<MailboxMutationRecordId> recordIds, CancellationToken cancellationToken)

Parameters

accounts IReadOnlyList<MailAccountId>

The accounts the caller is assigned, which are the accounts the records must belong to.

recordIds IReadOnlyList<MailboxMutationRecordId>

The records to read, in any order and with repetitions.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<MailboxMutationRecord>>

The records those accounts hold under those identities, ordered by when each was recorded, and empty where they hold none.

Remarks

The accounts are a parameter rather than something the caller checks afterwards, because they are what makes an identifier on a mailbox the caller is not assigned unreadable rather than merely unreported: a record outside them is absent from the answer, so no timing or shape separates one that exists from one that never did. A record identity is generated rather than guessable, and this is what keeps that from being the only thing standing between two mailboxes. An empty list therefore reads nothing rather than everything, which is what a caller assigned no account is answered with.

Every stage is answered, completed and terminal ones included, because the caller is asking where its own change got to and the answer it is waiting for is the one that says the change is done.

Exceptions

ArgumentNullException

Thrown when accounts or recordIds is null.