feat: add pub/sub support to dispatcher
Some checks failed
default / dotnet-default-workflow (pull_request) Failing after 1m46s
Some checks failed
default / dotnet-default-workflow (pull_request) Failing after 1m46s
Notifications are broadcast to zero or more handlers with configurable publishing strategies (sequential or parallel) and pipeline behavior support.
This commit is contained in:
parent
eff887b49f
commit
ed8ac913b6
27 changed files with 814 additions and 7 deletions
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (c) The Geekeey Authors
|
||||
// SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
namespace Geekeey.Request.Dispatcher.Tests;
|
||||
|
||||
public class OtherNotificationPublisher(NotificationTestTracker tracker) : INotificationPublisher
|
||||
{
|
||||
public async Task PublishAsync<TNotification>(IEnumerable<INotificationHandler<TNotification>> handlers, TNotification notification, CancellationToken cancellationToken) where TNotification : INotification
|
||||
{
|
||||
tracker.Log.Add("OtherPublisher");
|
||||
|
||||
foreach (var handler in handlers)
|
||||
{
|
||||
await handler.HandleAsync(notification, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue