Table of Contents

Class ReclaimContentObjectsJobPayload

Namespace
MailFathom.Application.Jobs.Payloads
Assembly
MailFathom.Application.dll

Points one job at the part of the bucket a sweep has not reached yet, and at nothing inside a message.

public sealed record ReclaimContentObjectsJobPayload : IJobPayload, IEquatable<ReclaimContentObjectsJobPayload>
Inheritance
ReclaimContentObjectsJobPayload
Implements
Inherited Members

Remarks

A sweep of a whole bucket is more work than one attempt may hold, so it is carried by a chain of jobs: the schedule dispatches the first naming the sweep it begins, and every one that stops with objects still ahead of it hands the rest to the next. The four properties are what the next one needs to be both resumable and enqueueable.

SweepId and Segment exist for the queue rather than for the work. An idempotency key is unique for the life of the table, so a chain that reused one would have its second segment silently answered as a job already enqueued; the sweep the chain belongs to and the place in it are what make each key its own.

The sweep is named by the occasion that dispatched it rather than by the attempt that carries it. The identity travels in the document the enqueue committed, so every execution of one leased segment reads the same one and composes the same hand-on key. Minting it inside ContinuingFrom(string, TimeSpan) would make it a property of the attempt instead: an attempt whose work succeeded and whose completion the store then refused is repeated against the same payload, and two mints would hand the same position to two keys and fork one sweep into two chains walking one bucket.

ResumeFrom is a position in the endpoint's listing. It is the one value here that came from the store rather than from MailFathom, and it names a place among keys rather than anything read out of a message — which is the same standard every other payload in this queue is written to.

Properties

JobType

Gets the job type this payload is the one contract of.

OldestOrphanAge

Gets the age of the oldest orphan the segments before this one met, zero for the segment that begins a sweep.

ResumeFrom

Gets the position in the listing this segment begins at, or null to begin at its start.

Segment

Gets which segment of that sweep this job carries, counted from the one the schedule dispatched.

SweepId

Gets the sweep this job is a segment of, which the occasion that dispatched the chain named.

Methods

ContinuingFrom(string, TimeSpan)

Describes the segment that carries whatever this one did not reach.

FromTheStart(string)

Describes the first segment of one sweep, which begins at the start of the listing.

ToIdempotencyKey()

Composes the identity under which this segment is enqueued.