Interface INotification
- Namespace
- SimpleMediator
- Assembly
- SimpleMediator.dll
Signal or event that can be published to multiple handlers.
public interface INotification
Examples
public sealed record InvoiceIssuedNotification(Guid InvoiceId) : INotification;
public sealed class NotifyAccountingHandler : INotificationHandler<InvoiceIssuedNotification>
{
public Task Handle(InvoiceIssuedNotification notification, CancellationToken cancellationToken)
{
// Send a message to the accounting system...
return Task.CompletedTask;
}
}
Remarks
Unlike IRequest<TResponse>, notifications do not expect a response. They are handy to propagate domain events or integrate asynchronous processes.