Method SubmitAsync
- Namespace
- MailFathom.Application.Spam.Runs
- Assembly
- MailFathom.Application.dll
SubmitAsync(MailAccountId, SpamClassificationRunTerms, CancellationToken)
Asks for every message stored for the account to be classified on the terms given.
public Task<SpamClassificationRunRequest> SubmitAsync(MailAccountId accountId, SpamClassificationRunTerms terms, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account to walk.
termsSpamClassificationRunTermsWhat the run should do.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<SpamClassificationRunRequest>
The run the account now has outstanding, and whether this request is what put it there.
Remarks
The read and the write are one committed decision rather than a check followed by an insert, 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.
Exceptions
- ArgumentNullException
Thrown when
termsis null.- PersistenceConcurrencyConflictException
Thrown when two requests raced past the bounded retries.
- OperationCanceledException
Thrown when the caller cancels.