Class MailboxExportHandler
- Namespace
- MailFathom.Application.Mail.Export
- Assembly
- MailFathom.Application.dll
Writes one export's archive, streaming each stored message into it and holding none of the mailbox.
public sealed class MailboxExportHandler : IJobHandler
- Inheritance
-
MailboxExportHandler
- Implements
- Inherited Members
Remarks
One attempt writes the whole archive rather than a chain of bounded passes, which is the opposite of every other long job here and for one reason: a zip is one object with one central directory at its end, so a pass that handed the rest to its successor would have to hand over a half-written object. An attempt that stops abandons the write, the store is left holding nothing under the key, and the export is asked for again.
It reads the export's record at a checkpoint, once every hundred messages, so an operator's cancellation reaches it within a hundred messages rather than at the end of a mailbox. The size limit is asked before every message instead of at that checkpoint, because a message admitted past the bound is already in the archive by the time the next checkpoint could refuse it.
Nothing here holds more than one message: the walk hands out identities, the content store answers one payload, and the archive writer writes it through and lets it go.
Constructors
- MailboxExportHandler(IMailboxExportStore, IMailboxExportReader, IMailboxExportArchiveStore, IEmailContentStore, IMailboxExportAuditor, MailboxExportSettings, TimeProvider)
Initializes the handler.
Properties
- JobType
Gets the job type this handler runs, which is also the contract its payload arrives under.
Methods
- RunAsync(IJobPayload, CancellationToken)
Runs the work the payload describes.