.NET API
IJobDispatcher
Tracon.Abstractions.dllQueues a job for a registered IJobHandler.
public interface IJobDispatcherRemarks
Section titled “Remarks”The supported way for consumer code to create work. IJobStore stays the persistence surface: it takes a fully formed JobRecord, so the caller has to invent the identifier, the status and the timestamps, and it accepts any handler key, including one nobody registered — such a job only fails later, in the worker. This interface closes both gaps.
It performs no authorization of its own: the caller is already inside the process. The HTTP surface has its own, narrower gate (TraconSchedulingOptions.HttpSchedulableHandlerKeys).
Lifetime: registered as a singleton and safe to
call from any thread; it holds no per-call state.
Tenant: takes an expected tenant —
JobRequest.TenantId is required and is the tenant the job is
queued for. The ambient tenant is not consulted; a caller that wants it
passes it explicitly.
Delivery: queueing itself is exactly one row — the method
either returns a queued JobRecord or throws, and it never
retries on its own. What happens afterwards is the queue’s contract, and
that is at-least-once: the handler may run more than once for the
job this call created (see IJobHandler.ExecuteAsync).
Methods
Section titled “Methods”EnqueueAsync(JobRequest, CancellationToken)
Section titled “ EnqueueAsync(JobRequest, CancellationToken)”Validates the request and queues the job.
ValueTask<JobRecord> EnqueueAsync(JobRequest request, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”request JobRequest
What to run, for whom, and with what input.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The queued job record, with its identifier and counters filled in.
Exceptions
Section titled “Exceptions”request is null.
JobRequest.HandlerKey is not registered, or the request’s tenant, target or lane is not valid.