Method EraseFolderMirrorAsync
- Namespace
- MailFathom.Application.Folders
- Assembly
- MailFathom.Application.dll
EraseFolderMirrorAsync(IPersistenceSession, MailAccountId, MailFolderAlias, int, CancellationToken)
Erases a bounded part of one folder's stored mail, and its checkpoint once nothing is left.
Task<MailFolderMirrorErasure> EraseFolderMirrorAsync(IPersistenceSession session, MailAccountId accountId, MailFolderAlias folderAlias, int maxEmails, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe write transaction this erasure joins.
accountIdMailAccountIdThe account the folder belongs to.
folderAliasMailFolderAliasMailFathom's own name for the folder.
maxEmailsintThe greatest number of emails this pass may erase.
cancellationTokenCancellationTokenCancels the read that selects the emails and the writes that stage their removal.
Returns
- Task<MailFolderMirrorErasure>
What this pass erased, and whether the folder still holds stored mail.
Remarks
The checkpoint is cleared in the same pass that empties the folder rather than in the first one, because a checkpoint removed while mail remains would make a mirrored folder resume in front of rows this pass has not reached. Clearing it at the end is what makes a folder somebody erased mirror afresh, while a folder merely switched off keeps its checkpoint and resumes from it.