Interface IDispatcher
- Namespace
- Arbiter.CommandQuery.Dispatcher
- Assembly
- Arbiter.CommandQuery.dll
An interface to represent a dispatcher for sending request messages.
public interface IDispatcher
Remarks
Dispatcher is an abstraction over the IMediator pattern, allowing for sending of requests over HTTP for remote scenarios and directly to IMediator for server side scenarios. Use this abstraction when using the Blazor Interactive Auto rendering mode.
Methods
Send<TResponse>(IRequest<TResponse>, CancellationToken)
Sends a request to the message dispatcher.
ValueTask<TResponse?> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default)
Parameters
request
IRequest<TResponse>The request being sent
cancellationToken
CancellationTokenCancellation token
Returns
- ValueTask<TResponse>
Awaitable task returning the
TResponse
Type Parameters
TResponse
The type of response from the dispatcher
Send<TRequest, TResponse>(TRequest, CancellationToken)
Sends a request to the message dispatcher.
ValueTask<TResponse?> Send<TRequest, TResponse>(TRequest request, CancellationToken cancellationToken = default) where TRequest : IRequest<TResponse>
Parameters
request
TRequestThe request being sent
cancellationToken
CancellationTokenCancellation token
Returns
- ValueTask<TResponse>
Awaitable task returning the
TResponse
Type Parameters
TRequest
The type of request being sent
TResponse
The type of response from the dispatcher