dolittle/DotNET.SDK

View on GitHub
Source/Services/ProcessingCoordinator.cs

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Collections.Generic;
using System.Threading.Tasks;

namespace Dolittle.SDK.Services;

/// <summary>
/// Represents an implementation of <see cref="ICoordinateProcessing" />.
/// </summary>
public class ProcessingCoordinator : ICoordinateProcessing
{
    readonly List<Task> _processors = new();

    /// <inheritdoc/>
    public Task Completion => Task.WhenAll(_processors);

    /// <inheritdoc/>
    public void RegisterProcessor(Task processor) => _processors.Add(processor);
}