Class ContentObjectReclamationHandler
- Namespace
- MailFathom.Application.EmailContent.Storage.Reclamation
- Assembly
- MailFathom.Application.dll
Carries one segment of a sweep for stored mail nothing points at any more.
public sealed class ContentObjectReclamationHandler : IJobHandler
- Inheritance
-
ContentObjectReclamationHandler
- Implements
- Inherited Members
Remarks
The queue is what makes the sweep safe to run at all on terms this system already owns. A job is leased, so two instances cannot sweep the same segment at once; an attempt is bounded by the execution timeout and cancelled at shutdown, so a bucket cannot hold a worker; and the concurrency gate is what makes it yield to ordinary work rather than compete with a synchronization run for the same capacity.
A segment that stops with objects still ahead of it hands the rest to a segment of its own, exactly as a re-derivation does. That is what keeps a bucket larger than one attempt reachable: without it every occasion would list the same first pages and the tail would never be swept. A queue that refuses the hand-on at its depth ends the attempt rather than being read as a sweep that finished, because the segment is the only record of where the walk had reached.
Running it twice with one payload is the same as running it once. Removing an object nothing holds succeeds, and the decision the run makes about each object is read from the endpoint and the database at the moment it makes it, so a second attempt over one segment removes what the first did not reach and nothing else. The hand-on is the same either way: the sweep and the place in it are read from the payload the enqueue committed rather than composed here, so a repeated attempt enqueues the key the first one did and is answered with the segment already waiting.
A deployment that stores content in the database has no bucket and reclaims nothing. The job type is still known to this build, so a segment enqueued before the endpoint was taken away is answered rather than left for a handler nothing registered.
Constructors
- ContentObjectReclamationHandler(IJobStore, IContentObjectReclamation?)
Initializes the handler from the sweep it drives and the queue it hands the rest of one to.
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.