Class StoredContentClaim
- Namespace
- MailFathom.Application.EmailContent.Storage
- Assembly
- MailFathom.Application.dll
Holds room under both of StoredContentCeiling's ceilings while one payload is fetched and stored.
public sealed class StoredContentClaim : IAsyncDisposable
- Inheritance
-
StoredContentClaim
- Implements
- Inherited Members
Remarks
A claim is taken against what a message is expected to occupy, before it is fetched, and given back once the payload has reached storage or been abandoned. Disposing it is what gives it back, so a fetch that was abandoned and a commit that was rolled back both leave the ceilings where they found them rather than reserving room nothing occupies. It covers the deployment's population and its user's together, because a payload occupies both and giving one back without the other would leave a ceiling describing storage that is not there.
There is no settling step, and its absence is the point. What a stored payload occupies is read from storage itself on the next claim rather than carried in a level between measurements, so a claim released after the commit leaves nothing behind to reconcile — the bytes are in what the next reading measures. Releasing it before the commit would be the mistake, which is why the release is disposal at the end of the store rather than a call the caller places.
A claim taken where the deployment bounds nothing names no reservation and releases none. It exists so a caller reads a granted attempt the same way whether or not a ceiling was declared.
Properties
- ClaimedBytes
Gets what was claimed before the payload was fetched.
Methods
- DisposeAsync()
Gives back whatever the claim still holds.