Class StoredMailRederivationRequests
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
Takes a request to re-derive a scope's stored mail, and answers one that is already under way.
public sealed class StoredMailRederivationRequests
- Inheritance
-
StoredMailRederivationRequests
- Inherited Members
Remarks
The request is recorded and nothing is re-read here. The walk is carried by durable background work, so what this writes is the statement that the run is wanted together with the job that carries its first segment; the request thread neither performs the work nor keeps it alive, which is what stops an operator's terminal closing from cancelling a walk of their mailbox and what makes the answer immediate however large that mailbox is.
A second request while one is outstanding is answered with the run already in front of the scope rather than refused or queued. Asking twice for the same thing is asking once: what the caller wanted is for the mail to be re-read, and it is going to be.
The enqueue is made on every request rather than only on the one that started the run, and it is the same key each
time. That is what makes asking again the repair for the one state nothing else recovers from: a run whose segment
was written down but whose job never reached the queue, because the process stopped between the two writes or the
queue was full when it was asked. A job that is there is answered with itself and nothing is duplicated, and one
that was dead-lettered still holds its key — which is mfctl jobs retry's to return rather than this one's to
enqueue past, so the answer names it as a run nothing is carrying instead of reporting the enqueue as a success.
Constructors
- StoredMailRederivationRequests(IStoredMailRederivationRunStore, IJobStore, OptimisticConcurrencyRetryPolicy, TimeProvider, AccessAuthorization)
Initializes the request intake.
Methods
- KeyOf(StoredMailRederivationRun)
Composes the identity two enqueues of one segment of one run are compared by.
- SubmitAsync(StoredMailScope, CancellationToken)
Asks for every stored message of the scope to have its metadata re-read from the MIME already held.