Method RecordRecipientOutcomesAsync
- Namespace
- MailFathom.Application.Mail.Delivery
- Assembly
- MailFathom.Application.dll
RecordRecipientOutcomesAsync(IPersistenceSession, OutgoingEmailLease, OutgoingEmailId, IReadOnlyList<OutgoingRecipientOutcome>, CancellationToken)
Records what one attempt settled about the recipients it offered.
Task RecordRecipientOutcomesAsync(IPersistenceSession session, OutgoingEmailLease lease, OutgoingEmailId outgoingEmailId, IReadOnlyList<OutgoingRecipientOutcome> outcomes, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
leaseOutgoingEmailLeaseThe lease the attempt holds the record under.
outgoingEmailIdOutgoingEmailIdThe record the outcomes belong to.
outcomesIReadOnlyList<OutgoingRecipientOutcome>What the attempt settled, one entry per recipient it offered.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the outcomes are written.
Remarks
A recipient the record already settled keeps the answer it has. Nothing offers such a recipient again, so an outcome about one is an attempt reporting what it was told rather than a fact that can have changed, and taking it would let a later transient reply undo a delivery that already happened.
Exceptions
- ArgumentNullException
Thrown when
session,lease, oroutcomesis null.- OutgoingEmailLeaseLostException
Thrown when the record is held by a later attempt.
- InvalidOperationException
Thrown when no record carries
outgoingEmailId, when it has reached a terminal stage, or when an outcome names an address the record does not.