Table of Contents

Method ReadServedAccountsAsync

Namespace
MailFathom.Application.Accounts
Assembly
MailFathom.Application.dll

ReadServedAccountsAsync(CancellationToken)

Reads every account this deployment serves from the account records, deduplicated and ordered.

Task<IReadOnlyList<ServedMailAccount>> ReadServedAccountsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<ServedMailAccount>>

The accounts in the ordinal order of their identifiers, so a scope resolved from this set is canonical and a continuation cursor issued for it stays valid while the records do not change. An empty set means no account is served and therefore that no stored mail is readable, which is a state configuration allows: an operator may switch synchronization off and remove every account while a local copy still exists.

Remarks

The shape a reader of the whole set takes — the status an operator reads, the schedule that evaluates rules against every account — because it answers from the records themselves rather than from what this process composed, so a deployment's account count is a question of how large the answer is rather than of what every replica must hold.

ReadServedAccountsAsync(IReadOnlyCollection<MailAccountId>, CancellationToken)

Reads which of the named accounts this deployment serves.

Task<IReadOnlyList<ServedMailAccount>> ReadServedAccountsAsync(IReadOnlyCollection<MailAccountId> among, CancellationToken cancellationToken)

Parameters

among IReadOnlyCollection<MailAccountId>

The accounts asked about.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<ServedMailAccount>>

The served accounts among those named, in the ordinal order of their identifiers; one the deployment does not serve is left out.

Remarks

The shape a reader that has an account in hand takes — an operator naming one, a credential recorded against one, a caller's own assigned accounts — because it reads those accounts rather than the whole set, so what it costs is the size of the question rather than the size of the deployment.

Exceptions

ArgumentNullException

Thrown when among is null.