Method RecordOccurrenceAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Scheduling
- Assembly
- MailFathom.Application.dll
RecordOccurrenceAsync(IPersistenceSession, RecurringSendId, DateTimeOffset, OutgoingEmailId, CancellationToken)
Records the occasion a declaration has now produced a message for.
Task RecordOccurrenceAsync(IPersistenceSession session, RecurringSendId recurringSendId, DateTimeOffset occurrenceAt, OutgoingEmailId outgoingEmailId, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
recurringSendIdRecurringSendIdThe declaration the occasion belongs to.
occurrenceAtDateTimeOffsetThe occasion itself, rather than the moment it was noticed.
outgoingEmailIdOutgoingEmailIdThe message that occasion produced.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the occasion is durable.
Remarks
An occasion already recorded is not moved backwards. Two instances reaching one occasion write the same values, and a dispatch that ran late must not take a declaration back to an occasion a later one already passed.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no declaration carries
recurringSendId.