Table of Contents

Class JobTransition

Namespace
Millrace.Storage
Assembly
Millrace.dll

An engine-computed state transition applied atomically by the provider — the provider's only duty is to apply it all-or-nothing behind the fence; retry policy, backoff math, and continuation logic never live in providers (ARCHITECTURE.md §4.1).

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

Remarks

Fence. The transition applies iff the job's State == Processing, WorkerId == ExpectedWorkerId, and Attempt == ExpectedAttempt; otherwise ApplyAsync returns false and changes nothing. Because every claim increments Attempt, the fence is ABA-safe even when the same worker reclaims its own expired job.

Atomic effects. State change, Enqueue inserts, continuation activation/cancellation, and idempotency-key release commit together or not at all. Enqueue inserts follow EnqueueAsync semantics (active-key duplicates skip as no-ops; the Awaiting parent fixup applies); this transition's own terminal key release is visible to its inserts.

Continuations. CancelContinuations cancels the entire transitive closure of Awaiting descendants (via ParentId), each released from its idempotency scope. ActivateContinuations is deliberately one level deep — activated children later apply their own transitions; cancelled ones never do.

Properties

ActivateContinuations

Direct Awaiting children of JobId become Enqueued.

Bookmarks

Bookmarks inserted in the same transaction (workflow engine, 0.3).

CancelContinuations

The transitive Awaiting-descendant closure of JobId becomes Cancelled.

Checkpoint

A workflow instance update applied in the same transaction (workflow engine, 0.3).

DueAt

Retry activation time when TargetState is Failed.

Enqueue

Records inserted atomically with the transition (workflow engine, 0.3).

Error

Failure message to record, becoming LastError.

ExpectedAttempt

The attempt number the caller believes it is completing.

ExpectedWorkerId

The worker the caller believes holds the claim.

Failures

New Failures value (engine-computed).

FinishedAt

Completion time to stamp onto FinishedAt.

JobId

The job this transition applies to.

TargetState

Succeeded, Failed, Dead, Cancelled, or Enqueued (release — an interrupted job returned to the queue without consuming retry budget).