Table of Contents

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

session IPersistenceSession

The session the write joins.

request RecurringSendRequest

The repetition that was asked for.

draftByteLength long

How many bytes of MIME are being stored as the draft.

cancellationToken CancellationToken

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

ArgumentOutOfRangeException

Thrown when draftByteLength is not positive.