Method DeclareAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Scheduling
- Assembly
- MailFathom.Application.dll
DeclareAsync(IPersistenceSession, RecurringSendRequest, long, CancellationToken)
Writes the declaration down, or reads back the one that already holds this idempotency identity.
Task<RecurringSend> DeclareAsync(IPersistenceSession session, RecurringSendRequest request, long draftByteLength, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
requestRecurringSendRequestThe repetition that was asked for.
draftByteLengthlongHow many bytes of MIME are being stored as the draft.
cancellationTokenCancellationTokenCancels the write or the read that precedes it.
Returns
- Task<RecurringSend>
The declaration for this request, whether this call created it or an earlier one did.
Remarks
The declaration starts active and having produced nothing, so writing one sends nothing by itself. An identity that already has a declaration is answered with that declaration unchanged, including the schedule it was made with: a second call that meant to change the repetition has to stop this one and declare afresh, because a schedule edited underneath a running declaration would leave the occasions it already accounted for describing a repetition that no longer exists.
Exceptions
- ArgumentNullException
Thrown when
sessionorrequestis null.- ArgumentOutOfRangeException
Thrown when
draftByteLengthis not positive.