Method ReadLifecycleCountsAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
ReadLifecycleCountsAsync(MailAccountId, CancellationToken)
Counts one account's uncompleted mutations by kind and by where in its lifecycle each one stands.
Task<IReadOnlyList<MailboxMutationLifecycleCount>> ReadLifecycleCountsAsync(MailAccountId accountId, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account whose mutations are counted.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<MailboxMutationLifecycleCount>>
One entry per kind and lifecycle that has at least one record, in no particular order.
Remarks
It is an aggregate rather than a count of what ReadOutstandingAsync(MailAccountId, int, CancellationToken) returned, because that read is bounded and a bounded count is wrong exactly when it matters — the moment an account has more stuck changes than one pass looks at is the moment somebody needs the real number.
The database groups and counts, so the answer is a handful of rows however many mutations the account has: at most one per permitted mutation per lifecycle. Nothing derived from a message takes part in it.