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
sessionIPersistenceSessionThe session the write joins.
requestOutgoingEmailRequestThe send that was asked for.
principalOutgoingEmailPrincipalWhoever asked for it, as the record will remember them.
mimeByteLengthlongHow many bytes of MIME are being stored for this message.
cancellationTokenCancellationTokenCancels 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, orprincipalis null.- ArgumentOutOfRangeException
Thrown when
mimeByteLengthis not positive.