Class FireForgetDispatcher
- Namespace
- Savvyio.Dispatchers
- Assembly
- Savvyio.Core.dll
Provides a generic dispatcher that uses Fire-and-Forget/In-Only MEP. This is an abstract class.
public abstract class FireForgetDispatcher : Dispatcher, IDispatcher
- Inheritance
-
ObjectFireForgetDispatcher
- Implements
- Derived
- Inherited Members
Constructors
FireForgetDispatcher(IServiceLocator)
Initializes a new instance of the FireForgetDispatcher class.
protected FireForgetDispatcher(IServiceLocator serviceLocator)
Parameters
serviceLocator
IServiceLocatorThe provider of service implementations.
Methods
Dispatch<TRequest, THandler>(TRequest, Func<THandler, IFireForgetActivator<TRequest>>)
Dispatches the specified request
using Fire-and-Forget/In-Only MEP.
protected virtual void Dispatch<TRequest, THandler>(TRequest request, Func<THandler, IFireForgetActivator<TRequest>> handlerFactory)
where TRequest : IRequest where THandler : IHandler<TRequest>
Parameters
request
TRequestThe model that is being handled by a registered delegate.
handlerFactory
Func<THandler, IFireForgetActivator<TRequest>>The function delegate that will locate and invoke the handler registered to the specified
request
.
Type Parameters
TRequest
The type of the input model registered to a handler.
THandler
The type of the handler to locate the input model.
Remarks
A request
can be a command, domain event, integration event, query etc.
DispatchAsync<TRequest, THandler>(TRequest, Func<THandler, IFireForgetActivator<TRequest>>, Action<AsyncOptions>)
Dispatches the specified request
asynchronous using Fire-and-Forget/In-Only MEP.
protected virtual async Task DispatchAsync<TRequest, THandler>(TRequest request, Func<THandler, IFireForgetActivator<TRequest>> handlerFactory, Action<AsyncOptions> setup)
where TRequest : IRequest where THandler : IHandler<TRequest>
Parameters
request
TRequestThe model that is being handled by a registered delegate.
handlerFactory
Func<THandler, IFireForgetActivator<TRequest>>The function delegate that will locate and invoke the handler registered to the specified
request
.setup
Action<AsyncOptions>The AsyncOptions which may be configured.
Returns
- Task
A System.Threading.Tasks.Task that represents the asynchronous operation.
Type Parameters
TRequest
The type of the input model registered to a handler.
THandler
The type of the handler to locate the input model.
Remarks
A request
can be a command, domain event, integration event, query etc.