Interface IMediator
Entry point for processing messages with the mediator pattern
public interface IMediator
Methods
InvokeAsync<T>(object, CancellationToken, TimeSpan?)
Execute the message handling for this message synchronously and wait for the response. The message is handled locally and delegates immediately to the appropriate handler.
Task<T> InvokeAsync<T>(object message, CancellationToken cancellation = default, TimeSpan? timeout = null)
Parameters
messageobjectThe message/request to process
cancellationCancellationTokenCancellation token for async operations
timeoutTimeSpan?Optional timeout for the operation
Returns
- Task<T>
The response of type T from the handler
Type Parameters
TThe expected response type