Interface IStoredMailRederivationStore
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
The state the re-derivation pass reads and writes as it walks one scope's stored mail.
public interface IStoredMailRederivationStore
Remarks
One contract rather than several, for the reason the extraction backfill's is one: the operations describe a single restartable walk — where the last invocation stopped, which emails come next, what one email's re-reading produced, how far this invocation has come, and that the walk is over. A caller holding only some of them could not make the walk terminate.
The resume position is per scope, because two scopes are two walks and an operator refreshing one account must not move a cursor another account's walk is resuming from. It is cleared rather than parked once a walk finishes, so a later release's re-derivation of the same scope starts at the beginning instead of behind the last one.
Methods
- ApplyRederivedMetadataAsync(IPersistenceSession, StoredEmailId, ExtractedEmailMetadata, CancellationToken)
Writes what re-reading one email's MIME produced onto its existing row.
- ClearResumePositionAsync(IPersistenceSession, StoredMailScope, CancellationToken)
Forgets this scope's walk, which is what an invocation that reached the end of it records.
- FindResumePositionAsync(StoredMailScope, CancellationToken)
Reads the position the last committed batch of this scope's walk reached.
- GetEmailsToRederiveAsync(StoredMailScope, StoredEmailId?, int, CancellationToken)
Reads the next bounded batch of stored emails whose MIME this pass re-reads.
- SaveResumePositionAsync(IPersistenceSession, StoredMailScope, StoredEmailId, CancellationToken)
Records how far this scope's walk has come, so an interrupted pass resumes instead of restarting.