RetentionJobHandler
AgentPrism.Core.dllRuns a retention sweep (JobKind.Retention).
public sealed class RetentionJobHandler : IJobHandlerInheritance
Section titled “Inheritance”Implements
Section titled “Implements”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”JobRecord.TargetName is either a specific RetentionTargets
value or "*", which processes all active policies. The job has one item.
It reports the item when the entire run succeeds or fails.
Constructors
Section titled “Constructors”RetentionJobHandler(RetentionExecutor)
Section titled “ RetentionJobHandler(RetentionExecutor)”Runs a retention sweep (JobKind.Retention).
public RetentionJobHandler(RetentionExecutor executor)Parameters
Section titled “Parameters”executor RetentionExecutor
Remarks
Section titled “Remarks”JobRecord.TargetName is either a specific RetentionTargets
value or "*", which processes all active policies. The job has one item.
It reports the item when the entire run succeeds or fails.
Properties
Section titled “Properties”The job kind this handler can execute.
public JobKind Kind { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ExecuteAsync(JobContext, CancellationToken)
Section titled “ ExecuteAsync(JobContext, CancellationToken)”Executes the job.
public 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.