Method ProposeAsync
- Namespace
- MailFathom.Application.Tasks
- Assembly
- MailFathom.Application.dll
ProposeAsync(MailAccountId, StoredEmailId, IReadOnlyList<EmailTaskProposal>, CancellationToken)
Writes one message's readings onto the list of each person assigned the mailbox it arrived in.
public Task<int> ProposeAsync(MailAccountId account, StoredEmailId message, IReadOnlyList<EmailTaskProposal> proposals, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe mailbox the message arrived in, which is what decides whose lists these reach.
messageStoredEmailIdThe message the readings came out of, which every task written here cites.
proposalsIReadOnlyList<EmailTaskProposal>What the message asked for, which is empty where it asked for nothing.
cancellationTokenCancellationTokenCancels the writes; tasks already written stay durable.
Returns
Remarks
Nothing is read before anything is written, and a task already proposed from this message is not looked for. The pass takes a message out of the selection by deriving from it, so one message produces one derivation and the duplicate this would guard against has no path to occur — and a read per person per message would be a query on the arrival path for a case the pass already rules out.
Exceptions
- ArgumentNullException
Thrown when
proposalsis null.- OperationCanceledException
Thrown when the caller cancels.