Method AdvanceAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
AdvanceAsync(IPersistenceSession, MailboxMutationRecordId, MailboxMutationStage, RemoteEmailPlacement?, CancellationToken)
Moves the record to a later stage, recording the placement where the server named one.
Task AdvanceAsync(IPersistenceSession session, MailboxMutationRecordId recordId, MailboxMutationStage stage, RemoteEmailPlacement? placement, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
recordIdMailboxMutationRecordIdThe record to advance.
stageMailboxMutationStageThe stage the mutation has now reached.
placementRemoteEmailPlacementWhere the server said it put the email, or null to leave the recorded placement alone.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the stage is written.
Remarks
A stage only ever moves forward, so a late write from a lost attempt cannot pull a mutation back to a stage a retry has already passed.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no record carries
recordId, or when the record has already reached a terminal stage or a later one thanstage.