Start/Stop runners in parallel
Some of these background services do thing like loading records from
files, what it can be slow. But even more important is the fact that there
is no reason for one service to wait for the previous one, I mean, they
don't need to be started in serie.
MODIFY
WalletWasabi/WabiSabi/WabiSabiCoordinator.cs
WalletWasabi/WabiSabi/WabiSabiCoordinator.cs
@@ -45,9 +45,10 @@ namespace WalletWasabi.WabiSabi
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
- await ConfigWatcher.StartAsync(stoppingToken).ConfigureAwait(false);
- await Warden.StartAsync(stoppingToken).ConfigureAwait(false);
- await Arena.StartAsync(stoppingToken).ConfigureAwait(false);
+ await Task.WhenAll(
+ ConfigWatcher.StartAsync(stoppingToken),
+ Warden.StartAsync(stoppingToken),
+ Arena.StartAsync(stoppingToken)).ConfigureAwait(false);
}
public override async Task StopAsync(CancellationToken cancellationToken)
@@ -56,9 +57,10 @@ namespace WalletWasabi.WabiSabi
await base.StopAsync(cancellationToken).ConfigureAwait(false);
- await Arena.StopAsync(cancellationToken).ConfigureAwait(false);
- await ConfigWatcher.StopAsync(cancellationToken).ConfigureAwait(false);
- await Warden.StopAsync(cancellationToken).ConfigureAwait(false);
+ await Task.WhenAll(
+ Arena.StopAsync(cancellationToken),
+ ConfigWatcher.StopAsync(cancellationToken),
+ Warden.StopAsync(cancellationToken)).ConfigureAwait(false);
}
public override void Dispose()

Start/Stop runners in parallel

Some of these background services do thing like loading records from
files, what it can be slow. But even more important is the fact that there
is no reason for one service to wait for the previous one, I mean, they
don't need to be started in serie.