Table of Contents

Method OpenAsync

Namespace
MailFathom.Application.Mail.Delivery
Assembly
MailFathom.Application.dll

OpenAsync(IPersistenceSession, OutgoingEmailRequest, OutgoingEmailPrincipal, long, CancellationToken)

Writes the intent down, or reads back the record that already holds this idempotency identity.

Task<OpenedOutgoingEmail> OpenAsync(IPersistenceSession session, OutgoingEmailRequest request, OutgoingEmailPrincipal principal, long mimeByteLength, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The session the write joins.

request OutgoingEmailRequest

The send that was asked for.

principal OutgoingEmailPrincipal

Whoever asked for it, as the record will remember them.

mimeByteLength long

How many bytes of MIME are being stored for this message.

cancellationToken CancellationToken

Cancels the write or the read that precedes it.

Returns

Task<OpenedOutgoingEmail>

The record for this request, and whether this call is what wrote it down.

Remarks

The record starts at Recorded with every recipient unanswered and no attempt counted, so opening one sends nothing by itself. An identity that already has a record is answered with that record unchanged — including its recipients, its recorded length, and the principal the first request was made under — because the message a retry transmits has to be the one a previous attempt may already have begun transmitting.

Exceptions

ArgumentNullException

Thrown when session, request, or principal is null.

ArgumentOutOfRangeException

Thrown when mimeByteLength is not positive.