Calabonga.PipelineExecutor 1.0.0

dotnet add package Calabonga.PipelineExecutor --version 1.0.0
                    
NuGet\Install-Package Calabonga.PipelineExecutor -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Calabonga.PipelineExecutor" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Calabonga.PipelineExecutor" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Calabonga.PipelineExecutor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Calabonga.PipelineExecutor --version 1.0.0
                    
#r "nuget: Calabonga.PipelineExecutor, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Calabonga.PipelineExecutor&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Calabonga.PipelineExecutor&version=1.0.0
                    
Install as a Cake Tool

Calabonga.PipelineExecutor

Pipeline pattern implementation. Simple process executor with step-by-step pipeline execution You can use a Calabonga.PipelineExecutor as a nuget-package for your application.

dotnet add package Calabonga.PipelineExecutor

How to use

  1. You should have a object (class) for pipeline processing. Something like this:
public class Image
{
    public string Name { get; set; } = null!;

    public double Height { get; set; }

    public double Width { get; set; }
}
  1. Than you need create a steps for pipeline executor. This is a example for one of them (pay attention to base class of the ResizeStep, this is important):
public class ResizeStep : PipelineStep<Image>
{
    public override int OrderIndex => 2;

    public override Task<StepResult> ExecuteAsync(
        Image item,
        IPipelineContext<Image> context,
        ILogger<PipelineExecutor<Image>> logger,
        CancellationToken cancellationToken)
    {
        item.Height = 100;
        item.Width = 100;

        logger.LogInformation("[PIPELINE] Resize done 100 x 100");

        return Task.FromResult(StepResult.Success());
    }
}
  1. Make sure dependencies registered in your Dependency Container;
// Pipeline executor for Image processing
services.AddScoped<PipelineExecutor<Image>>();

// Pipeline executor default configuration for Image processing
services.AddScoped<IPipelineContext<Image>, DefaultPipelineContext<Image>>();

// Step 1 for pipeline executor processing 
services.AddScoped<IPipelineStep<Image>, ResizeStep>();

// Step 2 for pipeline executor processing 
services.AddScoped<IPipelineStep<Image>, UpdateNameStep>();

// Step 3 for pipeline executor processing 
services.AddScoped<IPipelineStep<Image>, UppercaseNameStep>();
  1. Custom configuration can be used:
/// <summary>
/// Custom configuration for <see cref="PipelineExecutor{T}"/>
/// with some additional parameters
/// </summary>
public class ImagePipelineContext : IPipelineContext<Image>
{
    public ImagePipelineContext(IOptions<AppSettings> settings)
    {
        ImageDefaultName = settings.Value.Name ?? "ImageFromPipeline.png";
    }

    /// <summary>
    /// Will be used in <see cref="UpdateNameStep"/>
    /// </summary>
    public string ImageDefaultName { get; }

    /// <summary>
    /// Strategy for steps executing when manual steps 
    /// added (<see cref="PipelineExecutor.AdditionalStepStrategy"/>).
    /// </summary>
    public AdditionalStepStrategy AdditionalStepStrategy => AdditionalStepStrategy.Append;

    /// <summary>
    /// Strategy when step operation failed. 
    /// See more <see cref="FailedStepStrategy"/>)
    /// </summary>
    public FailedStepStrategy FailedStepStrategy => FailedStepStrategy.NotStopPipeline;
}

If you want to use custom configuration, then you should replace registration in DI-container. Something like that:

// Pipeline executor default configuration for Image processing
//services.AddScoped<IPipelineContext<Image>, DefaultPipelineContext<Image>>();
services.AddScoped<IPipelineContext<Image>, ImagePipelineContext>();

History

1.0.0

  • First Release
  • More summary added/updated

1.0.0-beta.2

  • Project URL address fixed
  • Repository URL address fixed

1.0.0-beta.1

  • First release.

Screenshots

Console app result shown

image

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 276 6/12/2025
1.0.0-beta.2 249 6/11/2025
1.0.0-beta.1 193 6/9/2025

First release.