From 5623ec83da733791e3f05c34c4bdd9c84c6073e3 Mon Sep 17 00:00:00 2001 From: Doug Gish Date: Mon, 5 Jun 2023 15:20:45 -0600 Subject: [PATCH] Stop DomainEventDispatchers in series US592494 --- .../Events/Subscriber/DomainEventDispatcherInitializer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IO.Eventuate.Tram/Events/Subscriber/DomainEventDispatcherInitializer.cs b/IO.Eventuate.Tram/Events/Subscriber/DomainEventDispatcherInitializer.cs index d3f5a17..d28c3d1 100644 --- a/IO.Eventuate.Tram/Events/Subscriber/DomainEventDispatcherInitializer.cs +++ b/IO.Eventuate.Tram/Events/Subscriber/DomainEventDispatcherInitializer.cs @@ -29,8 +29,10 @@ public async Task StartAsync(CancellationToken cancellationToken) public async Task StopAsync(CancellationToken cancellationToken) { - Task[] stopTasks = _domainEventDispatchers.Select(d => d.StopAsync()).ToArray(); - await Task.WhenAll(stopTasks); + foreach (DomainEventDispatcher domainEventDispatcher in _domainEventDispatchers) + { + await domainEventDispatcher.StopAsync(); + } } } } \ No newline at end of file