Skip to content

Commit

Permalink
Stop DomainEventDispatchers in series
Browse files Browse the repository at this point in the history
US592494
  • Loading branch information
douggish committed Sep 18, 2023
1 parent 8b1e71c commit 74bf50a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
}

0 comments on commit 74bf50a

Please sign in to comment.