.NET API
JobRequest
Tracon.Abstractions.dllThe description of one job to queue through IJobDispatcher.
public sealed record JobRequest : IEquatable<JobRequest>- Inheritance
- object ← JobRequest
- Implements
- IEquatable<JobRequest>
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”JobRequest()
Section titled “ JobRequest()”public JobRequest()Properties
Section titled “Properties”HandlerKey
Section titled “ HandlerKey”The key of the handler to run. Must be registered with
AddJobHandler<T>(key), or be one of
JobHandlerKeys.BuiltIn.
public required string HandlerKey { get; init; }Property Value
Section titled “Property Value”The job’s items. Left empty, the items are extracted from JobRequest.Payload the same way a schedule’s payload is.
public IReadOnlyList<string> Items { get; init; }Property Value
Section titled “Property Value”The lane the job is queued under. Left at JobLanes.Default, TraconSchedulingOptions.LaneByHandlerKey may still route it elsewhere.
public string Lane { get; init; }Property Value
Section titled “Property Value”MaxAttempts
Section titled “ MaxAttempts”This job’s own attempt limit. null applies TraconSchedulingOptions.MaxAttempts.
public int? MaxAttempts { get; init; }Property Value
Section titled “Property Value”int?
MaxDuration
Section titled “ MaxDuration”The longest time one attempt of this job may run. null applies TraconSchedulingOptions.MaxDurationByHandlerKey, or no limit for a key the map does not list. See JobRecord.MaxDuration.
public TimeSpan? MaxDuration { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Must be from one millisecond to about 49.7 days.
Payload
Section titled “ Payload”The input set or parameters, interpreted by the handler.
public JsonElement Payload { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”An unset payload is queued as the empty JSON array, never as
JsonValueKind.Undefined or JSON null: an undefined
value cannot be written as JSON, and SQL Server rejects a null
literal in a JSON column. Every reader treats the empty array as “no payload”.
For JobHandlerKeys.Workflow and JobHandlerKeys.AgentBatch,
a JSON object whose members are all among items, userId and
labels is an attribution envelope: its items are the items
array, and its runs are attributed to that user and those labels.
ScheduledFor
Section titled “ ScheduledFor”The earliest time the job may run (UTC). null means as soon as a worker leases it.
public DateTimeOffset? ScheduledFor { get; init; }Property Value
Section titled “Property Value”TargetName
Section titled “ TargetName”The handler’s target — the agent or workflow name for the built-in keys. A handler that needs no target passes an empty string.
public required string TargetName { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”The tenant the job belongs to.
public required string TenantId { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(JobRequest?)
Section titled “ Equals(JobRequest?)”public bool Equals(JobRequest? other)Parameters
Section titled “Parameters”other JobRequest?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(JobRequest?, JobRequest?)
Section titled “ operator ==(JobRequest?, JobRequest?)”public static bool operator ==(JobRequest? left, JobRequest? right)Parameters
Section titled “Parameters”left JobRequest?
right JobRequest?
Returns
Section titled “Returns”operator !=(JobRequest?, JobRequest?)
Section titled “ operator !=(JobRequest?, JobRequest?)”public static bool operator !=(JobRequest? left, JobRequest? right)Parameters
Section titled “Parameters”left JobRequest?
right JobRequest?