Method SaveAsync
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
SaveAsync(IPersistenceSession, StoredMailRederivationRun, CancellationToken)
Stages a run — a request, a segment's progress, or its ending — in the session it commits through.
Task SaveAsync(IPersistenceSession session, StoredMailRederivationRun run, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe explicit persistence session this write participates in.
runStoredMailRederivationRunThe run as it stands.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task
A task that completes once the write is staged in the session.
Remarks
One run per scope, so this replaces whatever the scope last had rather than appending. Committing the counts with the segment they account for is what keeps the record and the chain of jobs from disagreeing about how far the walk has come.