IJobHandler
Namespace AgentPrism · Assembly
AgentPrism.Abstractions.dllThe extension point that provides job execution logic for a specific JobKind.
public interface IJobHandlerRemarks
Section titled “Remarks”Registered with AddJobHandler<T>. AgentPrism.Core provides
two implementations (JobKind.AgentBatch,
JobKind.Workflow); evaluation adds its own handler
(JobKind.Eval) the same way. The background worker picks
among the registered handlers by the IJobHandler.Kind field.
Properties
Section titled “Properties”The job kind this handler can execute.
JobKind Kind { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ExecuteAsync(JobContext, CancellationToken)
Section titled “ ExecuteAsync(JobContext, CancellationToken)”Executes the job.
ValueTask ExecuteAsync(JobContext context, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”context JobContext
The job context: record, items, reporting, and cancellation check.
cancellationToken CancellationToken
The cancellation token (triggered when the worker shuts down).
Returns
Section titled “Returns”The completion task.
Remarks
Section titled “Remarks”If the handler throws, the job is retried with IJobStore.ReleaseForRetryAsync (if the attempt limit is not exceeded) or marked as JobStatus.Failed.