17 lines
710 B
C#
17 lines
710 B
C#
namespace Toolkit.Framework.Foundation;
|
|
|
|
public interface IMediator
|
|
{
|
|
ValueTask Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification;
|
|
|
|
ValueTask<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default);
|
|
|
|
ValueTask<TResponse> Send<TResponse>(ICommand<TResponse> command, CancellationToken cancellationToken = default);
|
|
|
|
ValueTask<TResponse> Send<TResponse>(IQuery<TResponse> query, CancellationToken cancellationToken = default);
|
|
|
|
ValueTask<object?> Send(object message, CancellationToken cancellationToken = default);
|
|
|
|
void Subscribe(object subscriber);
|
|
}
|