Method SubmitAsync
- Namespace
- MailFathom.Application.Rules.Evaluation
- Assembly
- MailFathom.Application.dll
SubmitAsync(MailAccountId, CancellationToken)
Asks for the account's rules to be run over every message stored for it.
public Task<MailRuleEvaluationRunRequest> SubmitAsync(MailAccountId accountId, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account to run the rules over.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<MailRuleEvaluationRunRequest>
The run the account now has outstanding, and whether this request is what put it there.
Remarks
Whether the account is free is decided at the write rather than by a check in front of it, because two requests arriving together must resolve to one run. The loser of that race meets the account's own key, is retried from a fresh read, and is answered with the run the winner asked for.
A scheduled run in front of the account is replaced rather than answered with, because this request reaches every rule and that one reaches only the rules declaring a schedule.
Exceptions
- PersistenceConcurrencyConflictException
Thrown when two requests raced past the bounded retries.
- OperationCanceledException
Thrown when the caller cancels.