Table of Contents

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

session IPersistenceSession

The session the write joins.

recurringSendId RecurringSendId

The declaration the occasion belongs to.

occurrenceAt DateTimeOffset

The occasion itself, rather than the moment it was noticed.

outgoingEmailId OutgoingEmailId

The message that occasion produced.

cancellationToken CancellationToken

Cancels 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 session is null.

InvalidOperationException

Thrown when no declaration carries recurringSendId.