Class HandlerCollection
- Namespace
- CarrotMQ.Core.Configuration
- Assembly
- CarrotMQ.Core.dll
public class HandlerCollection
- Inheritance
-
HandlerCollection
- Inherited Members
Constructors
HandlerCollection(IServiceCollection, BindingCollection)
public HandlerCollection(IServiceCollection serviceCollection, BindingCollection bindingCollection)
Parameters
serviceCollectionIServiceCollectionbindingCollectionBindingCollection
Methods
AddCommand<TCommandHandler, TCommand, TResponse>()
Registers a command handler in the service configuration.
public Handler<TCommand, TResponse> AddCommand<TCommandHandler, TCommand, TResponse>() where TCommandHandler : CommandHandlerBase<TCommand, TResponse> where TCommand : class, _ICommand<TCommand, TResponse> where TResponse : class
Returns
- Handler<TCommand, TResponse>
Type Parameters
TCommandHandlerThe type of the command handler.
TCommandThe type of the command.
TResponseThe type of the response.
Remarks
This method registers the specified TCommandHandler in the CarrotMQ messaging service
configuration.
AddCustomRoutingEventSubscription<TCustomRoutingEvent>()
Registers an event subscription for a ICustomRoutingEvent<TEvent>.
public void AddCustomRoutingEventSubscription<TCustomRoutingEvent>() where TCustomRoutingEvent : class, ICustomRoutingEvent<TCustomRoutingEvent>
Type Parameters
TCustomRoutingEventThe type of the event.
Remarks
Registers a EventSubscription<TEvent> in the service collection which can be injected in your classes. You can then use EventReceived to receive the events.
AddCustomRoutingEvent<TEventHandler, TCustomRoutingEvent>()
Registers an event handler for a ICustomRoutingEvent<TEvent> in service configuration.
public void AddCustomRoutingEvent<TEventHandler, TCustomRoutingEvent>() where TEventHandler : EventHandlerBase<TCustomRoutingEvent> where TCustomRoutingEvent : class, ICustomRoutingEvent<TCustomRoutingEvent>
Type Parameters
TEventHandlerThe type of the event handler.
TCustomRoutingEventThe type of the event.
Remarks
This method registers the specified TEventHandler in the CarrotMQ messaging service
configuration.
AddEventSubscription<TEvent>()
Registers an event subscription for a IEvent<TEvent, TExchangeEndPoint>.
public Handler<TEvent, NoResponse> AddEventSubscription<TEvent>() where TEvent : class, _IEvent<TEvent>
Returns
- Handler<TEvent, NoResponse>
Type Parameters
TEventThe type of the event.
Remarks
Registers a EventSubscription<TEvent> in the service collection which can be injected in your classes. You can then use EventReceived to receive the events.
AddEvent<TEventHandler, TEvent>()
Registers an event handler in service configuration.
public Handler<TEvent, NoResponse> AddEvent<TEventHandler, TEvent>() where TEventHandler : EventHandlerBase<TEvent> where TEvent : class, _IEvent<TEvent>
Returns
- Handler<TEvent, NoResponse>
Type Parameters
TEventHandlerThe type of the event handler.
TEventThe type of the event.
Remarks
This method registers the specified TEventHandler in the CarrotMQ messaging service
configuration.
AddQuery<TQueryHandler, TQuery, TResponse>()
Registers a query handler in the service configuration.
public Handler<TQuery, TResponse> AddQuery<TQueryHandler, TQuery, TResponse>() where TQueryHandler : QueryHandlerBase<TQuery, TResponse> where TQuery : class, _IQuery<TQuery, TResponse> where TResponse : class
Returns
- Handler<TQuery, TResponse>
Type Parameters
TQueryHandlerThe type of the query handler.
TQueryThe type of the query.
TResponseThe type of the response.
Remarks
This method registers the specified TQueryHandler in the CarrotMQ messaging service
configuration.
AddResponseSubscription<TRequest, TResponse>()
Registers a response subscription.
public void AddResponseSubscription<TRequest, TResponse>() where TRequest : class, _IRequest<TRequest, TResponse> where TResponse : class
Type Parameters
TRequestThe type of the request.
TResponseThe type of the response.
Remarks
Registers a ResponseSubscription<TRequest, TResponse> in the service collection which can be injected in your classes. You can then use ResponseSubscription<TRequest, TResponse> to receive the responses.
AddResponse<TResponseHandler, TRequest, TResponse>()
Registers a response handler in the service configuration.
public void AddResponse<TResponseHandler, TRequest, TResponse>() where TResponseHandler : ResponseHandlerBase<TRequest, TResponse> where TRequest : class, _IRequest<TRequest, TResponse> where TResponse : class
Type Parameters
TResponseHandlerThe type of the response handler.
TRequestThe type of the request.
TResponseThe type of the response.
Remarks
This method registers the specified TResponseHandler in the CarrotMQ messaging service
configuration.
GetHandlers()
Gets all registered handlers in the configuration.
public IDictionary<string, HandlerProcessorBase> GetHandlers()
Returns
- IDictionary<string, HandlerProcessorBase>
A dictionary of handler keys and associated handler processors.