Pipes.Net 0.1.1

dotnet add package Pipes.Net --version 0.1.1
NuGet\Install-Package Pipes.Net -Version 0.1.1
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="Pipes.Net" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pipes.Net --version 0.1.1
#r "nuget: Pipes.Net, 0.1.1"
#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.
// Install Pipes.Net as a Cake Addin
#addin nuget:?package=Pipes.Net&version=0.1.1

// Install Pipes.Net as a Cake Tool
#tool nuget:?package=Pipes.Net&version=0.1.1

Pipes.Net

Badge
Target Frameworks Targets

Pipes.Net aims to bundle reoccuring simple workflows in an interactive object structure.

It can be easily extended with new nodes and features, as well as modifying the existing features to match any challenges.

Installation

The library is published to NuGet and can be installed through the .NET CLI

> dotnet add package Pipes.Net

or the Visual Studio Package Manager

PM> Install-Package Pipes.Net

Getting Started

Every Piece of Code utilizing Pipes.Net needs to include the following using clauses:

using Pipes.Net;
using Pipes.Net.Extensions;

Pipelines can be created using an Factory Pattern:

var factory = new PipelineFactory();
var pipeline = factory.Build();

You can add content to the pipeline using the specified Factory functions:

var pipeline = new PipelineFactory()
    .AddAction(() => Console.WriteLine("Hello World"))
    .Build();

From default there are additional Items enabling a more complex possibility of building Pipelines:

var pipeline = new PipelineFactory()
    .AddDecision<int>(x => x >= 30, success => 
        success.AddAction<int>((score) => Console.WriteLine($"Passed Test with a score of {score}"))
            .AddAction<int>((score) => 6-5 * score / 100)
            .AddSplit(MergeConditions.AllFinished,
                x => x.AddAction<int>((grade) => Console.WriteLine($"Grade: {grade}")),
                x => x.AddAction(() => Console.WriteLine("Storing Grade on Server"))
                    .AddAction(() => Thread.Sleep(3000))// Simulate some sort of Time consuming Action                    
            )
            .AddAction(() => Console.WriteLine($"Grading and uploading has finished"))
        ,failure => failure.AddAction((score) => Console.WriteLine($"Score of {score} does not qualify as a passing score"))
    ).Build();      

The Pipeline can then be run like this:

await pipeline.Run(56);

and the Output will look like this:

Passed Test with a score of 56
Grade: 4
Storing Grade on Server
Grading and uploading has finished

You can also run the same Pipeline multiple times using different Inputs:

await pipeline.Run(98);

that will result in different Outputs

Passed Test with a score of 98
Grade: 2
Storing Grade on Server
Grading and uploading has finished

Head to the wiki for more examples, or check out the code of the example project.

Contributing

You are welcome to share any improvement Ideas or Bugs you encoutered in the issues page.

It is greatly appreciated if you take the time to fork and contribute to this project.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.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
0.1.1 191 2/2/2023
0.1.0 175 2/2/2023