Skip to content
Tracon

TraconSchedulingOptions

Namespace Tracon · Assembly Tracon.Abstractions.dll

Batch and scheduled run settings.

public sealed class TraconSchedulingOptions

objectTraconSchedulingOptions

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

Read from the Tracon:Scheduling configuration section. See TraconServiceCollectionExtensions.UseScheduling.

public TraconSchedulingOptions()

The configuration section name.

public const string SectionName = "Tracon:Scheduling"

string

Whether the scheduling subsystem is enabled.

public bool Enabled { get; set; }

bool

The handler keys PUT /api/schedules/{name} accepts. Empty — the default — means the built-in keys only (JobHandlerKeys.BuiltIn).

public IList<string> HttpSchedulableHandlerKeys { get; }

IList<string>

A handler key is a dispatch identity, so an unrestricted schedule endpoint would turn every registered handler — including internal ones a consumer registered for its own background work — into an externally callable surface. This list is the opt-in: a consumer that wants its own key schedulable over HTTP names that key here, explicitly.

A non-empty list replaces the built-in default, it does not extend it. This is deliberate — narrowing the surface (allowing only JobHandlerKeys.AgentBatch, say) is a thing an allow-list has to be able to express. The consequence is that a list naming only a consumer key turns every built-in key off; a consumer that wants both adds the built-in keys it needs alongside its own, for example [.. JobHandlerKeys.BuiltIn, "contoso.nightly-report"].

It restricts only the HTTP schedule endpoint. Code paths inside the process (IJobDispatcher, the built-in producers) are not affected, and neither is reading: GET /api/jobs?handlerKey= still returns jobs of any key the caller’s tenant owns.

Maps a handler key to the lane its jobs are queued under, when the caller did not set JobRecord.Lane/JobSchedule.Lane explicitly.

public IDictionary<string, string> LaneByHandlerKey { get; }

IDictionary<string, string>

Applied once, inside IJobStore.EnqueueAsync: a job whose Lane is still JobLanes.Default at enqueue time is routed through this map by its JobRecord.HandlerKey. This lets an operator isolate one kind of work (for example JobHandlerKeys.Retention, or a consumer’s own key) into its own lane without changing any call site that creates those jobs.

The lanes this worker leases from. null (the default) leases from every lane — the same behavior as before lanes existed.

public IReadOnlyList<string>? Lanes { get; set; }

IReadOnlyList<string>?

A worker that only wants to run a specific lane’s jobs in a dedicated process sets this instead of registering a second JobWorkerBackgroundService: the background service is a single TryAddEnumerable registration keyed by implementation type, so a second host process with its own TraconSchedulingOptions.Lanes value is the supported way to dedicate capacity, not a second in-process worker.

A job’s lease duration. If the worker does not finish within this time, the job may be re-leased.

public TimeSpan LeaseDuration { get; set; }

TimeSpan

The maximum number of attempts a job may make before becoming JobStatus.Failed.

public int MaxAttempts { get; set; }

int

The maximum number of jobs that may run concurrently in this process.

public int MaxConcurrentJobs { get; set; }

int

Per-lane concurrency limits. A lane not listed here shares the common TraconSchedulingOptions.MaxConcurrentJobs budget.

public IDictionary<string, int> MaxConcurrentJobsPerLane { get; }

IDictionary<string, int>

The sum of these values is allowed to exceed TraconSchedulingOptions.MaxConcurrentJobs: each listed lane gets its own dedicated budget, on top of the shared one that unlisted lanes still draw from. There is no combined cap.

If TraconSchedulingOptions.Lanes is left null (unrestricted) while this dictionary is non-empty, the worker’s effective coverage narrows to JobLanes.Default plus the lanes listed here — it does not also lease from an arbitrary lane nobody configured a budget for. This keeps the “which lanes get how much capacity” question answerable from this dictionary alone; a job queued under an unlisted, non-default lane simply is not leased by this worker (it stays visible in GET /api/jobs?lane= and the jobs screen). Set TraconSchedulingOptions.Lanes explicitly to include such a lane.

The maximum number of items allowed in a single job.

public int MaxItemsPerJob { get; set; }

int

How often new jobs and due schedules are looked for.

public TimeSpan PollInterval { get; set; }

TimeSpan

Whether the background worker runs in this process. If set to false, the queue and schedule stores keep working, but no job is leased or executed in this process — distribution is left to another process.

public bool RunWorker { get; set; }

bool