Class JobHandlerRegistry
- Namespace
- MailFathom.Application.Jobs.Execution
- Assembly
- MailFathom.Application.dll
Answers which job types this process can run, and which handler runs each of them.
public sealed class JobHandlerRegistry
- Inheritance
-
JobHandlerRegistry
- Inherited Members
Remarks
It is asked twice for every pass and for two different reasons. The claim is filtered to the types named here, so a job a deployment cannot run is left where it is rather than taken and abandoned; and dispatch then asks again for the one job it holds, because the two questions are answered at different moments and a type registered for neither would otherwise reach the work.
A process with no handler at all is the ordinary state of a build whose consumers have not arrived yet, so an empty registry is valid and the worker's answer to it is to claim nothing.
Constructors
- JobHandlerRegistry(IEnumerable<IJobHandler>)
Indexes the handlers this process registered.
Properties
- HandledTypes
Gets the job types this process has a handler for, in a stable order.
Methods
- TryGetHandler(JobType, out IJobHandler?)
Finds the handler that runs one job type.