Method ReleaseAsync
- Namespace
- MailFathom.Application.EmailContent.Release
- Assembly
- MailFathom.Application.dll
ReleaseAsync(EmailContentKind, DateTimeOffset, int, CancellationToken)
Frees a bounded batch of one payload kind's retained copies, leaving every row pointing at its object.
Task<ReleasedContentPayloads> ReleaseAsync(EmailContentKind kind, DateTimeOffset verifiedOnOrBefore, int batchSize, CancellationToken cancellationToken)
Parameters
kindEmailContentKindThe payload kind to free, which decides the table.
verifiedOnOrBeforeDateTimeOffsetThe latest verification instant a copy may carry and still be freed, which is the safety interval expressed as a cutoff.
batchSizeintThe greatest number of copies to free.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<ReleasedContentPayloads>
How many copies were freed and how much they were holding.
Remarks
This is the irreversible step, and the only one in the move. What it removes is the last copy of a message this deployment holds outside the bucket, so the caller is the one that establishes there is nothing left to copy; this performs what it was asked for and nothing more.
The recorded length and digest are untouched, which is what keeps a released payload checkable against its object afterwards. Only the bytes go.
The rows are read before they are freed, because the volume is what an operator is being shown and a statement answering with a row count cannot say how much it removed. A row a concurrent write replaced between the two is left alone by the freeing statement's own predicate and is therefore not counted, so the count reports what was freed and the volume what the batch described.
Exceptions
- ArgumentOutOfRangeException
Thrown when
kindnames no payload kind, orbatchSizeis not positive.