# JobLanes

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.joblanes/
> Summary: JobLanes: Well-known values and validation for job lane identifiers.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Well-known values and validation for job `lane` identifiers.

```csharp
public static class JobLanes
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.joblanes/">JobLanes</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

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

## Fields

### <a id="Tracon_JobLanes_Default"></a> Default

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

```csharp
public const string Default = "default"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### <a id="Tracon_JobLanes_IsValidName_System_String_"></a> IsValidName\(string?\)

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

```csharp
public static bool IsValidName(string? name)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)?

The candidate name.

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the name is valid.

#### Remarks

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.

### <a id="Tracon_JobLanes_Resolve_System_String_System_String_System_Collections_Generic_IDictionary_System_String_System_String__"></a> Resolve\(string, string, IDictionary<string, string\>?\)

Resolves the lane a job is enqueued under, applying
`TraconSchedulingOptions.LaneByHandlerKey` when
`lane` is still [JobLanes.Default](/api/tracon.joblanes/#Tracon_JobLanes_Default), then validates
the result.

```csharp
public static string Resolve(string lane, string handlerKey, IDictionary<string, string>? laneByHandlerKey)
```

#### Parameters

`lane` [string](https://learn.microsoft.com/dotnet/api/system.string)

The lane requested by the caller ([JobRecord.Lane](/api/tracon.jobrecord/#Tracon_JobRecord_Lane)).

`handlerKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The job's handler key ([JobRecord.HandlerKey](/api/tracon.jobrecord/#Tracon_JobRecord_HandlerKey)).

`laneByHandlerKey` [IDictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [string](https://learn.microsoft.com/dotnet/api/system.string)\>?

The configured key-to-lane map. May be [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or empty.

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

The resolved, valid lane name.

#### Remarks

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](/api/tracon.jobschedule/#Tracon_JobSchedule_Lane)) is never overridden.

#### Exceptions

 [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception)

The resolved name is not a valid lane name.
