Skip to content
Tracon

JobLanes

Namespace Tracon · Assembly Tracon.Abstractions.dll

Well-known values and validation for job lane identifiers.

public static class JobLanes

objectJobLanes

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

A lane is a plain string tag on a job (JobRecord.Lane); it has no registry or lifecycle of its own, and it is not the job’s dispatch identity (that is JobRecord.HandlerKey). Worker instances subscribe to a subset of lanes (TraconSchedulingOptions.Lanes) to avoid head-of-line blocking between unrelated kinds of work.

The lane every job carries unless a different one is set explicitly.

public const string Default = "default"

string

Checks whether name is a valid lane name: 1-64 characters, lowercase ASCII letters, digits, ., _, or -, starting with a letter or digit.

public static bool IsValidName(string? name)

name string?

The candidate name.

bool

true if the name is valid.

Uppercase letters are rejected, not normalized. Lane names are compared ordinally everywhere (queries, worker subscriptions); allowing case variants would let "Media" and "media" silently become two different lanes, with the second one’s jobs never leased by a worker that only knows about the first.

Resolve(string, string, IDictionary<string, string>?)

Section titled “ Resolve(string, string, IDictionary<string, string>?)”

Resolves the lane a job is enqueued under, applying TraconSchedulingOptions.LaneByHandlerKey when lane is still JobLanes.Default, then validates the result.

public static string Resolve(string lane, string handlerKey, IDictionary<string, string>? laneByHandlerKey)

lane string

The lane requested by the caller (JobRecord.Lane).

handlerKey string

The job’s handler key (JobRecord.HandlerKey).

laneByHandlerKey IDictionary<string, string>?

The configured key-to-lane map. May be null or empty.

string

The resolved, valid lane name.

Called from every IJobStore.EnqueueAsync implementation — the one place every job, from every call site, passes through. A caller that already set an explicit, non-default lane (an HTTP request body, or a schedule’s own JobSchedule.Lane) is never overridden.

ArgumentException

The resolved name is not a valid lane name.