Simplify.Pipelines
1.0.0
dotnet add package Simplify.Pipelines --version 1.0.0
NuGet\Install-Package Simplify.Pipelines -Version 1.0.0
<PackageReference Include="Simplify.Pipelines" Version="1.0.0" />
<PackageVersion Include="Simplify.Pipelines" Version="1.0.0" />
<PackageReference Include="Simplify.Pipelines" />
paket add Simplify.Pipelines --version 1.0.0
#r "nuget: Simplify.Pipelines, 1.0.0"
#:package Simplify.Pipelines@1.0.0
#addin nuget:?package=Simplify.Pipelines&version=1.0.0
#tool nuget:?package=Simplify.Pipelines&version=1.0.0
Simplify.Pipelines Documentation
Provides a conveyor (production line) for processing an item through a sequence of stages. Both synchronous and asynchronous models are available, and the conveyor raises events when processing starts and after each stage completes.
Available at NuGet as binary package
All public types live in the Simplify.Pipelines.ProductionLine namespace.
Concepts
| Role | Synchronous | Asynchronous |
|---|---|---|
| Single processing step | IConveyorStage<T> |
IAsyncConveyorStage<T> |
| Ordered set of stages | IConveyor<T> (impl. Conveyor<T>) |
IAsyncConveyor<T> (impl. AsyncConveyor<T>) |
| Item source | IConveyorItemPreparer<T> |
IAsyncConveyorItemPreparer<T> |
| Prepare + run | IConveyorExecutor<T> (impl. ConveyorExecutor<T>) |
IAsyncConveyorExecutor<T> (impl. AsyncConveyorExecutor<T>) |
Key signatures:
public interface IConveyorStage<in T> { void Execute(T item); }
public interface IAsyncConveyorStage<in T> { Task Execute(T item); }
public interface IConveyor<T> { void Execute(T item); event ConveyorAction<T> OnConveyorStart; event ConveyorStageAction<T> OnStageExecuted; }
public interface IAsyncConveyor<T> { Task Execute(T item); event ConveyorAction<T> OnConveyorStart; event ConveyorStageAction<T> OnStageExecuted; }
public interface IConveyorItemPreparer<out T> { T GetItem(); }
public interface IAsyncConveyorItemPreparer<T> { Task<T> GetItem(); }
public interface IConveyorExecutor<out T> { T Execute(); }
public interface IAsyncConveyorExecutor<T> { Task<T> Execute(); }
The event delegates are:
public delegate void ConveyorAction<in T>(T item);
public delegate void ConveyorStageAction<in T>(Type stageType, T item);
Conveyor<T> / AsyncConveyor<T> are constructed from a list of stages, and the executors are constructed from a conveyor and an item preparer:
public Conveyor(IList<IConveyorStage<T>> stages);
public AsyncConveyor(IList<IAsyncConveyorStage<T>> stages);
public ConveyorExecutor(IConveyor<T> conveyor, IConveyorItemPreparer<T> itemPreparer);
public AsyncConveyorExecutor(IAsyncConveyor<T> conveyor, IAsyncConveyorItemPreparer<T> itemPreparer);
When the executor's Execute() is called it asks the item preparer for an item, raises OnConveyorStart, runs the item through each stage in order, raises OnStageExecuted after each stage, and returns the processed item.
Synchronous example
using System.Collections.Generic;
using Simplify.Pipelines.ProductionLine;
public class Order
{
public int Id { get; set; }
public decimal Amount { get; set; }
public string? Status { get; set; }
}
public class ValidateStage : IConveyorStage<Order>
{
public void Execute(Order item)
{
if (item.Amount <= 0)
throw new InvalidOperationException("Amount must be positive");
item.Status = "Validated";
}
}
public class CompleteStage : IConveyorStage<Order>
{
public void Execute(Order item) => item.Status = "Completed";
}
public class OrderPreparer : IConveyorItemPreparer<Order>
{
public Order GetItem() => new Order { Id = 1, Amount = 99.99m };
}
var stages = new List<IConveyorStage<Order>>
{
new ValidateStage(),
new CompleteStage()
};
var conveyor = new Conveyor<Order>(stages);
conveyor.OnConveyorStart += order => Console.WriteLine($"Started order {order.Id}");
conveyor.OnStageExecuted += (stageType, order) =>
Console.WriteLine($"{stageType.Name} done, status: {order.Status}");
var executor = new ConveyorExecutor<Order>(conveyor, new OrderPreparer());
Order processed = executor.Execute();
Asynchronous example
Use the Async* counterparts; stages return Task and the executor's Execute() returns Task<T>:
using System.Collections.Generic;
using Simplify.Pipelines.ProductionLine;
public class AsyncValidateStage : IAsyncConveyorStage<Order>
{
public async Task Execute(Order item)
{
await Task.Yield();
item.Status = "Validated";
}
}
public class AsyncOrderPreparer : IAsyncConveyorItemPreparer<Order>
{
public Task<Order> GetItem() => Task.FromResult(new Order { Id = 1, Amount = 99.99m });
}
var stages = new List<IAsyncConveyorStage<Order>> { new AsyncValidateStage() };
var conveyor = new AsyncConveyor<Order>(stages);
var executor = new AsyncConveyorExecutor<Order>(conveyor, new AsyncOrderPreparer());
Order processed = await executor.Execute();
Dependency injection
Simplify.Pipelines does not ship dedicated Simplify.DI registration extensions. Register the conveyor, its stages, the item preparer, and the executor in your container manually (for example via DIContainer.Current.Register<...>()), or construct them directly as shown above.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.0.0 | 55 | 6/25/2026 | |
| 0.9.3 | 126 | 5/26/2026 | |
| 0.9.2 | 1,510 | 8/1/2023 | |
| 0.9.1 | 748 | 5/2/2022 | |
| 0.9.0 | 2,231 | 1/27/2021 | |
| 0.8.1 | 739 | 10/29/2020 | |
| 0.8.0 | 700 | 10/28/2020 | |
| 0.7.1 | 803 | 1/30/2020 | |
| 0.7.0 | 1,020 | 1/27/2020 | |
| 0.6.0 | 1,044 | 1/27/2020 | |
| 0.5.1 | 850 | 1/24/2020 | |
| 0.5.0 | 867 | 1/24/2020 | |
| 0.4.0 | 764 | 1/15/2020 | |
| 0.3.1 | 1,713 | 4/22/2018 | |
| 0.3.0 | 1,386 | 5/29/2017 | |
| 0.2.0 | 1,358 | 2/3/2017 |