.NET API
JobRecord
Tracon.Abstractions.dllThe summary of a queued job. The header of its items (JobItemRecord).
public sealed record JobRecord : IEquatable<JobRecord>- Inheritance
- object ← JobRecord
- Implements
- IEquatable<JobRecord>
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”JobRecord()
Section titled “ JobRecord()”public JobRecord()Properties
Section titled “Properties”Attempt
Section titled “ Attempt”The number of lease attempts. Increments each time a worker leases the job.
public int Attempt { get; init; }Property Value
Section titled “Property Value”CompletedAt
Section titled “ CompletedAt”The completion time (UTC). null while the job is in progress.
public DateTimeOffset? CompletedAt { get; init; }Property Value
Section titled “Property Value”CreatedAt
Section titled “ CreatedAt”The creation time (UTC).
public required DateTimeOffset CreatedAt { get; init; }Property Value
Section titled “Property Value”DoneItems
Section titled “ DoneItems”The number of items that completed successfully.
public int DoneItems { get; init; }Property Value
Section titled “Property Value”ErrorMessage
Section titled “ ErrorMessage”The failure message. Populated only for JobStatus.Failed.
public string? ErrorMessage { get; init; }Property Value
Section titled “Property Value”FailedItems
Section titled “ FailedItems”The number of items that failed.
public int FailedItems { get; init; }Property Value
Section titled “Property Value”HandlerKey
Section titled “ HandlerKey”The key of the IJobHandler that executes this job. See JobHandlerKeys.
public required string HandlerKey { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Both the job’s classification and its dispatch identity; there is no second field. The worker matches it against the registered keys ordinally, so a job whose key nobody registered fails with JobErrorCodes.UnknownHandlerKey instead of running the wrong handler.
The job identifier.
public required Guid Id { get; init; }Property Value
Section titled “Property Value”The lane this job runs in. See JobLanes. A worker only
leases jobs from the lanes it subscribes to
(TraconSchedulingOptions.Lanes).
public string Lane { get; init; }Property Value
Section titled “Property Value”LeaseOwner
Section titled “ LeaseOwner”The identifier of the worker currently leasing the job. null if not leased.
public string? LeaseOwner { get; init; }Property Value
Section titled “Property Value”LeaseUntil
Section titled “ LeaseUntil”The time the current lease expires (UTC). The job may be re-leased once it expires.
public DateTimeOffset? LeaseUntil { get; init; }Property Value
Section titled “Property Value”MaxAttempts
Section titled “ MaxAttempts”The maximum number of attempts specific to this job. If
null, TraconSchedulingOptions.MaxAttempts applies.
public int? MaxAttempts { get; init; }Property Value
Section titled “Property Value”int?
Remarks
Section titled “Remarks”Webhook delivery uses a ladder different from the global setting; this field prevents a single global number from being forced onto every kind of job.
MaxDuration
Section titled “ MaxDuration”The longest time one attempt of this job may run. If null,
TraconSchedulingOptions.MaxDurationByHandlerKey applies to the job’s
handler key, and a key the map does not list has no limit.
public TimeSpan? MaxDuration { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”When the time is up, the worker cancels the token it gave the handler. A handler that stops then fails the attempt with JobErrorCodes.MaxDurationExceeded; the job is leased again while attempts are left, and the next attempt gets the full time again. A handler that ignores its token is waited for, and keeps its worker slot until it returns. One that returns normally after the time is up completes the job.
Kept in the store beside JobRecord.MaxAttempts. A store that does not keep it loses it: the job then runs under the map’s value, or without a limit. A stored value a timer cannot arm (outside 1 ms to about 49.7 days) is logged and skipped the same way.
Payload
Section titled “ Payload”The input set or parameters.
public JsonElement Payload { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”An unset payload is stored 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”.
ScheduleId
Section titled “ ScheduleId”The identifier of the schedule that produced this job. null for manually created (one-off) jobs.
public Guid? ScheduleId { get; init; }Property Value
Section titled “Property Value”Guid?
ScheduledFor
Section titled “ ScheduledFor”The earliest time the job is eligible to run (UTC).
public required DateTimeOffset ScheduledFor { get; init; }Property Value
Section titled “Property Value”StartedAt
Section titled “ StartedAt”The time the first lease happened (UTC).
public DateTimeOffset? StartedAt { get; init; }Property Value
Section titled “Property Value”Status
Section titled “ Status”The job’s current status.
public required JobStatus Status { get; init; }Property Value
Section titled “Property Value”TargetName
Section titled “ TargetName”The agent or workflow name to run.
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”TotalItems
Section titled “ TotalItems”The total number of items.
public int TotalItems { 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(JobRecord?)
Section titled “ Equals(JobRecord?)”public bool Equals(JobRecord? other)Parameters
Section titled “Parameters”other JobRecord?
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 ==(JobRecord?, JobRecord?)
Section titled “ operator ==(JobRecord?, JobRecord?)”public static bool operator ==(JobRecord? left, JobRecord? right)Parameters
Section titled “Parameters”left JobRecord?
right JobRecord?
Returns
Section titled “Returns”operator !=(JobRecord?, JobRecord?)
Section titled “ operator !=(JobRecord?, JobRecord?)”public static bool operator !=(JobRecord? left, JobRecord? right)Parameters
Section titled “Parameters”left JobRecord?
right JobRecord?