Method RecordTransmissionBegunAsync
- Namespace
- MailFathom.Application.Mail.Delivery
- Assembly
- MailFathom.Application.dll
RecordTransmissionBegunAsync(IPersistenceSession, OutgoingEmailLease, OutgoingEmailId, CancellationToken)
Moves the record to TransmissionBegun.
Task RecordTransmissionBegunAsync(IPersistenceSession session, OutgoingEmailLease lease, OutgoingEmailId outgoingEmailId, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
leaseOutgoingEmailLeaseThe lease the attempt holds the record under.
outgoingEmailIdOutgoingEmailIdThe record to advance.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the stage is written.
Remarks
It is a transition of its own rather than a value passed to AdvanceAsync(IPersistenceSession, OutgoingEmailLease, OutgoingEmailId, OutgoingEmailStage, int?, CancellationToken), because it is the one that has to be durable before the act it describes. Announcing it afterwards would be announcing it only when the crash it exists for did not happen.
Exceptions
- ArgumentNullException
Thrown when
sessionorleaseis null.- OutgoingEmailLeaseLostException
Thrown when the record is held by a later attempt.
- InvalidOperationException
Thrown when no record carries
outgoingEmailId, or when it is not at Recorded.