Method DeliverAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Outbox
- Assembly
- MailFathom.Application.dll
DeliverAsync(ClaimedOutgoingEmail, MailTransportSecurityPolicy, CancellationToken)
Attempts one claimed send and records what became of it.
[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Every way an attempt can end has to reach the record, because a submission that left the deployment and was not written down is the one failure this design exists to remove; the failure is classified into a recorded code rather than swallowed.")]
public Task<MailOutboxDeliveryResult> DeliverAsync(ClaimedOutgoingEmail claimed, MailTransportSecurityPolicy transportSecurityPolicy, CancellationToken stoppingToken)
Parameters
claimedClaimedOutgoingEmailThe send this attempt holds, with the lease it holds it under.
transportSecurityPolicyMailTransportSecurityPolicyThe connection and authentication policy the submission obeys.
stoppingTokenCancellationTokenStops the attempt when the host is shutting down.
Returns
- Task<MailOutboxDeliveryResult>
What the attempt did, which is already durable by the time it is returned.
Remarks
It does not raise for a send that failed. Everything the attempt learned is written onto the record first, so a caller reads the outcome rather than catching it — which is what lets one send's failure leave the sends beside it untouched.
Exceptions
- ArgumentNullException
Thrown when
claimedortransportSecurityPolicyis null.