Method SubmitAsync
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
SubmitAsync(StoredMailScope, CancellationToken)
Asks for every stored message of the scope to have its metadata re-read from the MIME already held.
public Task<StoredMailRederivationRequest> SubmitAsync(StoredMailScope scope, CancellationToken cancellationToken)
Parameters
scopeStoredMailScopeThe account, and the one folder of it, to re-read.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<StoredMailRederivationRequest>
The run the scope now has, whether this request started it, and what is carrying it.
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 scope's own key, is retried from a fresh read, and is answered with the run the winner asked for.
Asking a deployment to walk a whole mailbox is work it performs on request, which is the grant it asks for. Reading where the run got to is a different grant, and neither implies the other.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- PersistenceConcurrencyConflictException
Thrown when two requests raced past the bounded retries.
- PrincipalNotAuthorizedException
Thrown when the use case was reached by anything but a caller granted AdminOperate.
- OperationCanceledException
Thrown when the caller cancels.