Allow the Mediator to be subscribed to and therefore handled

This commit is contained in:
TheXamlGuy
2024-05-15 19:28:08 +01:00
parent 7e57c0d28d
commit 8c0436644a
6 changed files with 67 additions and 24 deletions
+6 -2
View File
@@ -3,7 +3,11 @@ namespace Toolkit.Foundation
{
public interface IMediator
{
Task<object?> Handle(object message, CancellationToken cancellationToken = default);
Task<TResponse?> Handle<TRequest, TResponse>(TRequest request, CancellationToken cancellationToken = default) where TRequest : notnull;
Task<object?> Handle(object message,
CancellationToken cancellationToken = default);
Task<TResponse?> Handle<TMessage, TResponse>(TMessage message,
CancellationToken cancellationToken = default)
where TMessage : notnull;
}
}