/// <inheritdoc/> public void Dispose() { DistributionServices.LogStatistics(m_loggingContext); m_masterServer.Dispose(); if (m_remoteWorkers != null) { // Finish and dispose all workers Task.WaitAll(m_remoteWorkers.Select(static w => w.FinishAsync(null).ContinueWith(_ => w.Dispose())).ToArray());
/// <inheritdoc/> public void Dispose() { DistributionServices.LogStatistics(m_loggingContext); m_masterServer.Dispose(); // Consider switching to `IAsyncDisposable.DisposeAsync` in this code to avoid blocking calls in Dispose method. if (m_remoteWorkers != null) { // Finish and dispose all workers var tasks = m_remoteWorkers .Select(
/// <inheritdoc/> public void Dispose() { DistributionServices.LogStatistics(m_loggingContext); m_masterServer.Dispose(); if (m_remoteWorkers != null) { foreach (Worker worker in m_remoteWorkers) { worker.Dispose(); } } }