Skip to content

RetentionJobHandler

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Runs a retention sweep (JobKind.Retention).

public sealed class RetentionJobHandler : IJobHandler

objectRetentionJobHandler

IJobHandler

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

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.

Runs a retention sweep (JobKind.Retention).

public RetentionJobHandler(RetentionExecutor executor)

executor RetentionExecutor

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.

The job kind this handler can execute.

public JobKind Kind { get; }

JobKind

ExecuteAsync(JobContext, CancellationToken)

Section titled “ ExecuteAsync(JobContext, CancellationToken)”

Executes the job.

public ValueTask ExecuteAsync(JobContext context, CancellationToken cancellationToken = default)

context JobContext

The job context: record, items, reporting, and cancellation check.

cancellationToken CancellationToken

The cancellation token (triggered when the worker shuts down).

ValueTask

The completion task.

If the handler throws, the job is retried with IJobStore.ReleaseForRetryAsync (if the attempt limit is not exceeded) or marked as JobStatus.Failed.