Mediator API

Trax.Mediator runs a train from its input or its name rather than from an injected train interface: ITrainBus dispatches by the input's type in process, ITrainExecutionService by name with JSON input. How the pieces fit is on Mediator.

Trax.Mediator

PageWhat it documents
ITrainBusRunAsync, RunByNameAsync and InitializeTrain: in-process dispatch by input type or by name
ITrainDiscoveryServiceThe registered trains, as TrainRegistration records
ITrainExecutionServiceQueueAsync, RunAsync and PrepareAsync: a train by name, with JSON input
TrainInputReaderThe rules every surface reads train input JSON by
Mediator exceptionsThe exceptions in Trax.Mediator.Exceptions
Concurrency limitsConcurrentRunLimit, PerPrincipalMaxConcurrentRun, GlobalConcurrentRunLimit and [TraxConcurrencyLimit]
IConcurrencyLimiterThe permit gate behind the concurrency limits
ICurrentPrincipalProviderThe caller id the per-principal limit buckets by
ITrustedExecutionScopeMarks an async flow as trusted infrastructure, which skips per-train authorization
MediatorConfigurationThe resolved mediator settings, readable from the container
AddMediatorWhere AddMediator is documented
AddServiceTrainBusThe registration AddMediator performs, and RegisterServiceTrains

Trax.Effect.Data

PageWhat it documents
IEnqueueContextAccessorThe data context an enqueue commits on, for an OnQueue hook. AddMediator registers it