using System.Collections.Generic;
using System.Threading;
using MfGames.Gallium;
namespace MfGames.Nitride.Pipelines;
/// <summary>
/// Implements the basic signature for a pipeline, a distinct unit of
/// processing that reads, manipulates, and writes data.
/// </summary>
public interface IPipeline
{
/// Gets the dependencies for the pipeline.
IEnumerable<IPipeline> GetDependencies();
/// Performs various operations such as reading, writing, and
/// transformation on the given entities before returning a new
/// collection, which may or may not include some of the original
/// entities.
/// <param name="entities">The entities to process.</param>
/// <param name="cancellationToken">The token for cancelling processing.</param>
/// <returns>The resulting entities after the process runs.</returns>
IAsyncEnumerable<Entity> RunAsync(
IEnumerable<Entity> entities,
CancellationToken cancellationToken = default);
}