Method SubmitScheduledAsync
- Namespace
- MailFathom.Application.Rules.Evaluation
- Assembly
- MailFathom.Application.dll
SubmitScheduledAsync(MailAccountId, CancellationToken)
Asks, on a rule's own declared occasion, for the account's scheduled rules to be run over its mailbox.
public Task<MailRuleEvaluationRunRequest> SubmitScheduledAsync(MailAccountId accountId, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account to run the scheduled rules over.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<MailRuleEvaluationRunRequest>
The run the account now has outstanding, and whether this occasion is what put it there.
Remarks
Any run already outstanding is the answer, whatever started it. A run somebody asked for reaches every rule this occasion wanted and more, and a scheduled run is the same walk arriving early, so both make a second walk of one mailbox work nobody needs — which is the guarantee the mechanism dispatching this occasion also makes about the job it enqueued.
It asks for no permission, deliberately, and requires the process itself instead. What reaches it is a job this deployment enqueued from a rule's own declared schedule, so there is no caller to hold a grant, and requiring an administrative one here would mean the schedule ran under a credential nobody presented. Requiring the process identity is what makes that an admitted case rather than an unasked question: a caller reaching this method from an entrypoint added later is refused instead of starting a mailbox-wide pass under no grant at all.
Exceptions
- PersistenceConcurrencyConflictException
Thrown when two requests raced past the bounded retries.
- OperationCanceledException
Thrown when the caller cancels.
- PrincipalNotAuthorizedException
Thrown when anything but this deployment's own process reached the use case.