Class HandlerProcessorBase
- Namespace
- CarrotMQ.Core.MessageProcessing
- Assembly
- CarrotMQ.Core.dll
Base class for handler processors responsible for instantiating the associated message handlers .
public abstract class HandlerProcessorBase
- Inheritance
-
HandlerProcessorBase
- Inherited Members
Remarks
The HandlerProcessorBase class provides common functionality for creating metadata about handlers and handling messages.
Constructors
HandlerProcessorBase(string)
Initializes a new instance of the HandlerProcessorBase class.
protected HandlerProcessorBase(string handlerKey)
Parameters
handlerKeystringThe unique key associated with the handler.
Exceptions
- ArgumentException
Thrown if the
handlerKeyis null, empty, or consists only of white-space characters.
Methods
GetHandler<THandler, TMessage, TResponse>(IDependencyInjector)
Gets an instance of the specified handler type, using the scoped dependency injector.
protected static THandler GetHandler<THandler, TMessage, TResponse>(IDependencyInjector scopedDependencyInjector) where THandler : HandlerBase<TMessage, TResponse> where TMessage : _IMessage<TMessage, TResponse> where TResponse : class
Parameters
scopedDependencyInjectorIDependencyInjectorThe scoped dependency injector.
Returns
- THandler
An instance of the specified handler type.
Type Parameters
THandlerThe type of the handler to create.
TMessageThe type of the message the handler processes.
TResponseThe type of the response the handler generates.
Exceptions
- InvalidOperationException
Thrown if no handler of the specified type could be instantiated.