Table of Contents

Class JobClaimRequest

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

Asks for work this process can actually run, and says under what lease it would hold it.

public sealed record JobClaimRequest : IEquatable<JobClaimRequest>
Inheritance
JobClaimRequest
Implements
Inherited Members

Remarks

The claim is filtered to the types the asking process has a handler for, which is what makes a rolling deployment safe: a job whose type an older replica does not know is left where it is for a newer one to take, because the absence of a handler is a fact about the deployment and not about the work.

The lease duration is the caller's because the bound belongs with the timeout the work runs under, and the two are ordered against each other — an attempt is cancelled before its lease can expire underneath it. Nothing here enforces that ordering; it is enforced where both values are configured.

Properties

BatchSize

Gets the greatest number of jobs this claim may take.

HandledTypes

Gets the job types this process has a handler for.

LeaseDuration

Gets how long the claim holds each job it takes.

Owner

Gets the attempt the claimed jobs are stamped with.

Methods

Create(IReadOnlyList<JobType>, int, TimeSpan, JobLeaseOwner)

States what this process can run and how long it would hold it for.