JobContext
AgentPrism.Abstractions.dllThe context available during an IJobHandler execution.
public sealed class JobContextInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The handler does not access IJobStore directly; this keeps the handler focused only on execution logic and removes the need to set up a fake store in a unit test.
Constructors
Section titled “Constructors”JobContext()
Section titled “ JobContext()”public JobContext()Properties
Section titled “Properties”IsCancelledAsync
Section titled “ IsCancelledAsync”Checks whether the job was cancelled by an external request
(POST .../cancel). The handler supports cooperative
cancellation by checking this between items.
public required Func<CancellationToken, ValueTask<bool>> IsCancelledAsync { get; init; }Property Value
Section titled “Property Value”Func<CancellationToken, ValueTask<bool>>
The job’s items, by sequence number.
public required IReadOnlyList<JobItemRecord> Items { get; init; }Property Value
Section titled “Property Value”The record of the job being executed.
public required JobRecord Job { get; init; }Property Value
Section titled “Property Value”ReportItemAsync
Section titled “ ReportItemAsync”Reports an item’s processing result. The handler must call this as each item is processed; the result is reflected into the persistent store and the job’s counters.
public required Func<JobItemResult, CancellationToken, ValueTask> ReportItemAsync { get; init; }