Table of Contents

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

session IPersistenceSession

The explicit persistence session this removal participates in.

emailId StoredEmailId

The message whose passages are removed.

cancellationToken CancellationToken

Cancels 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.