Method ResolveAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Addressing
- Assembly
- MailFathom.Application.dll
ResolveAsync(IReadOnlyList<NamedRecipient>, CancellationToken)
Resolves every recipient one authored message names.
public Task<RecipientResolution> ResolveAsync(IReadOnlyList<NamedRecipient> recipients, CancellationToken cancellationToken)
Parameters
recipientsIReadOnlyList<NamedRecipient>The people the author named, in the order they named them.
cancellationTokenCancellationTokenCancels the reads of the book.
Returns
- Task<RecipientResolution>
The recipients to compose with, or the refusal that stopped one of them.
Remarks
One recipient that resolves to nobody refuses the whole message. The order the author wrote is kept, because it is the order the composition writes its headers in, and an address the author supplied is carried through unparsed: parsing it is the composition's to do and to refuse.
The identities named and the names are each read in groups of at most a page of the book, so a message costs one read per way its recipients were named, and a second of one such way only past two hundred distinct people in it. Both ways are named out of one recipient list, and that list is bounded below twice two hundred, so at most one of them ever reaches its second read: three for the longest list an outgoing record can hold, against one per recipient. What addressing costs therefore follows from how a message was addressed rather than from how many people it goes to. The count is bounded before the first lookup all the same, because the reads carry what the caller supplied: the bound is the greatest number of recipients an outgoing record can hold at all, so a longer list describes a send that could not be written down whatever the book answered — and the deployment's own, smaller recipient bound is still the composition's to apply, where it is refused as a bound rather than raised as a defect.
Exceptions
- ArgumentNullException
Thrown when
recipientsis null.- ArgumentOutOfRangeException
Thrown when more recipients are named than an outgoing message may hold, which is a caller that assembled something it did not mean rather than an author to refuse.