Interface IContentObjectReclamation
- Namespace
- MailFathom.Application.EmailContent.Storage.Reclamation
- Assembly
- MailFathom.Application.dll
Removes the stored mail nothing points at any more, one bounded run at a time.
public interface IContentObjectReclamation
Remarks
The second of the two mechanisms that keep a bucket honest, and it answers the failure the first one cannot. A deliberate erasure removes the object after the transaction that removed its row has committed; this removes what that never reached — an object written by a unit of work that never committed, a draft revision a later one superseded, and the object of any erasure whose removal the endpoint refused.
An object nothing points at is mail nobody agreed to keep. That is what makes this a privacy obligation rather than a way of saving storage, and it is why the interval it runs on and the age below which it leaves an object alone are settings the retention documentation states rather than housekeeping.
The implementation is bounded in three ways at once and none of them is optional: it pages the listing rather than reading one, it stops after a configured number of objects so an attempt cannot hold a worker for a whole bucket, and it observes cancellation between pages so a shutdown ends it where it stands. What it does not reach is ResumeFrom, and the run after it starts there.
Running it twice over one object is the same as running it once, and two runs that overlap are safe: removing a key nothing holds succeeds, so the worst an overlap costs is a second request. What neither can do is remove an object a row points at, because the reference check is read after the listing and an object younger than the age floor is left alone whatever the check says.
Methods
- ReclaimAsync(string?, TimeSpan, CancellationToken)
Reclaims what one bounded run reaches, beginning where the previous one stopped.