Table of Contents

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

accountId MailAccountId

The account to walk.

terms SpamClassificationRunTerms

What the run should do.

cancellationToken CancellationToken

Cancels 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 terms is null.

PersistenceConcurrencyConflictException

Thrown when two requests raced past the bounded retries.

OperationCanceledException

Thrown when the caller cancels.