Method RunAsync
- Namespace
- MailFathom.Application.EmailContent.Move
- Assembly
- MailFathom.Application.dll
RunAsync(CancellationToken)
Runs one bounded pass of the move, if the deployment has one to carry.
public Task<StoredContentMovePass> RunAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancels the pass between payloads.
Returns
- Task<StoredContentMovePass>
What this pass carried, and whether the database still holds payloads behind it.
Remarks
It asks for no permission and requires the process itself instead, exactly as every other walk this deployment drives on its own does. What reaches it is a worker rather than a caller, so there is nobody here to hold a grant; the operator's grant is asked for where the operator is, which is StoredContentMoveControl.
A move that is paused, finished, or was never asked for reports an idle pass and touches nothing, and the state is read again between payloads. That is what makes pausing immediate without cancelling anything: the pass finishes the payload it holds and ends there, rather than carrying the rest of what its ceilings would have allowed after somebody asked it to stop.
Cancellation between payloads ends the pass rather than raising, and cancellation during one still commits what the pass reached before the exception leaves: what a pass repointed is durable on its own, so the worst a stopped pass costs is the one payload it was carrying — which the next pass carries from the beginning.
Exceptions
- PrincipalNotAuthorizedException
Thrown when anything but this deployment's own process reached the use case.
- OperationCanceledException
Thrown when the caller cancels while a payload is being carried, however many the pass had already carried and committed before it.
- PersistenceConcurrencyConflictException
Thrown when committing this pass's progress raced an operator's decision past the bounded retries.