DispatchAsync Method
Definition
- Namespace
- Savvyio.Dispatchers
- Assemblies
- Savvyio.Core.dll
DispatchAsync<TRequest, THandler, TResponse>(TRequest, Func<THandler, IRequestReplyActivator<TRequest>>, Action<AsyncOptions>)
Dispatches the specified request asynchronous using Request-Reply/In-Out MEP.
protected virtual Task<TResponse> DispatchAsync<TRequest, THandler, TResponse>(TRequest request, Func<THandler, IRequestReplyActivator<TRequest>> handlerFactory, Action<AsyncOptions> setup) where TRequest : IRequest where THandler : IHandler<TRequest>
Parameters
requestTRequestThe model that is being handled by a registered delegate.
handlerFactoryFunc<THandler, IRequestReplyActivator<TRequest>>The function delegate that will locate and invoke the handler registered to the specified
request.setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
- Task<TResponse>
A task that represents the asynchronous operation. The task result contains the response of the request.
Type Parameters
TRequestThe type of the input model registered to a handler.
THandlerThe type of the handler to locate the input model.
TResponseThe type of the output model.
Remarks
A request can be a command, domain event, integration event, query etc.