Method DiscardChunksAsync
- Namespace
- MailFathom.Application.Emails.Chunking
- Assembly
- MailFathom.Application.dll
DiscardChunksAsync(IPersistenceSession, StoredEmailId, CancellationToken)
Stages the removal of every passage cut from one message.
Task<int> DiscardChunksAsync(IPersistenceSession session, StoredEmailId emailId, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe explicit persistence session this removal participates in.
emailIdStoredEmailIdThe message whose passages are removed.
cancellationTokenCancellationTokenCancels the read before anything is staged.
Returns
- Task<int>
How many passages the removal reached, which is zero for a message that was never chunked.
Remarks
Idempotent, so a caller that repeats it removes nothing the second time and reports zero. Staged rather than committed, so the removal and whatever decided on it reach the database together.