Constructor JobHandlerRegistry
- Namespace
- MailFathom.Application.Jobs.Execution
- Assembly
- MailFathom.Application.dll
JobHandlerRegistry(IEnumerable<IJobHandler>)
Indexes the handlers this process registered.
public JobHandlerRegistry(IEnumerable<IJobHandler> handlers)
Parameters
handlersIEnumerable<IJobHandler>Every handler the composition root supplied.
Remarks
Two handlers for one type are refused rather than resolved by order, because either could be the one meant and choosing silently would make which one runs depend on registration order. It is a defect in how the process was composed rather than a condition a run can recover from, so the refusal is raised where it is noticed rather than absorbed into an outcome.
Exceptions
- ArgumentNullException
Thrown when
handlersis null.- ArgumentException
Thrown when a handler names the unspecified job type, or when two handlers name one type.