Skip to content

PackSite/Library.Pipelining

Repository files navigation

Library.Pipelining

CI Coverage

Version Downloads

Version Downloads

Version Downloads

PackSite.Library.Pipelining is a set of .NET 8 compatible libraries for building modern ASP.NET Core middleware-like data pipelines.

Features

  • Uses Microsoft.Extensions.* to support a modular library design (can also be used without Generic Host but with limited features).
  • Support for asynchronous processing model.
  • Transient, Scoped, and Singleton pipeline lifetime.
  • Pipelines distinguished by custom names or pipeline argument data type.
  • Fluent pipeline builder (for defining pipeline name, description, and steps).
  • Highly configurable steps order using Add, Insert, InsertBefore, InsertAfter methods.
  • Dynamic sub-pipelines.
  • Generic and object-based steps.
  • Code-first pipeline definitions during Generic Host start and at runtime through IPipelineCollection.
  • Optional configuration-based pipelines definitions using IOptions with reloading.
  • Pipeline counters: executions count (successful and failure) and speed (microsecond resolution).
  • Very fast step execution (see Benchmarks section).

Examples

See Examples folder for all library usage examples.

Benchmarks

BenchmarkDotNet v0.13.10, Windows 10 (10.0.19045.3693/22H2/2022Update)
Intel Core i7-4790 CPU 3.60GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
.NET SDK 8.0.100
  [Host]     : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
  DefaultJob : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
Method Mean Error StdDev Ratio RatioSD Rank
'Steps.Count == 1' 12.02 us 0.148 us 0.124 us 0.33 0.01 1
'Steps.Count == 2' 15.43 us 0.164 us 0.153 us 0.42 0.01 2
'Steps.Count == 5' 29.47 us 0.202 us 0.179 us 0.80 0.01 3
'Loop simulation (i == 100)' 36.82 us 0.447 us 0.418 us 1.00 0.00 4
'Steps.Count == 10' 57.59 us 0.417 us 0.390 us 1.56 0.02 5
'Steps.Count == 50' 276.01 us 2.743 us 2.432 us 7.50 0.12 6
'Steps.Count == 100' 563.48 us 2.442 us 2.165 us 15.31 0.15 7

Every pipeline was invoked 100 times - so for pipeline with 5 steps, a 500 steps were executed.