Table of Contents

Class JobLeaseOwner

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

Names the attempt that holds a lease, so a later write can be refused when the lease has moved on.

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

Remarks

It identifies one attempt rather than one process. Completion, renewal, and release are all conditional on this value still matching the row, and a worker that lost its lease, finished late, and tried to write its result finds the row owned by the attempt that replaced it and writes nothing. A value that named only the process would let a reclaimed job be completed by the attempt whose lease had already expired.

The text is MailFathom's own — a generated identity for the attempt — and never anything from a message.

Fields

MaximumLength

The greatest length an owner may have, which bounds the column it is stored in.

Properties

Value

Gets the text a stored lease is compared against.

Methods

Create(string)

Creates an owner for one attempt.

NewAttempt()

Creates an owner for a new attempt, unique across every process that shares the database.

ToString()

Returns a string that represents the current object.