NetPipe 0.9.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package NetPipe --version 0.9.1
NuGet\Install-Package NetPipe -Version 0.9.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="NetPipe" Version="0.9.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPipe --version 0.9.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetPipe, 0.9.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 NetPipe as a Cake Addin #addin nuget:?package=NetPipe&version=0.9.1 // Install NetPipe as a Cake Tool #tool nuget:?package=NetPipe&version=0.9.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Simple pipeline
This library has the concept of a set of pipes joint by connectors where pipes are just code that do a single task and connectors coordinate the execution. Each pipe receives a load which is just a dictionary with the state of the current task, each pipe can read/write information from that dictionary.
Simple example:
Task 1 -> Task 2 -> Task 3
var testLoad = new Dictionary<string, object>();
var runner = new PipeLine()
.Pipe(load => load["Task 1"] = true)
.Connect()
.Pipe(load => load["Task 2"] = true)
.Connect()
.Pipe(load => load["Task 3"] = true)
.Finish();
runner.Run(testLoad);
Now the load
dictionary should look something like this:
Key | Value |
---|---|
Task 1 | true |
Task 2 | true |
Task 3 | true |
Basic condition example:
-> Task 2 -
| |
Task 1 -> o -> Task 3 -o -> Task 5
| |
-> Task 4 -
var pipeLine = new PipeLine()
.Pipe(load => load["Task 1"] = true)
.ConnectWhen((pipes, load) =>
{
var chosenPath = load["ChosenPipe"].ToString();
return pipes.OfType<NamedPipe>().First(p => p.Name == chosenPath);
})
.Pipe("pipe2", load => load["Task 2"] = true) // Named pipe
.Pipe("pipe3", load => load["Task 3"] = true) // Named pipe
.Pipe("pipe4", load => load["Task 4"] = true) // Named pipe
.Join()
.Pipe(load => load["Task 5"] = true)
.Finish();
// Runs Task 1 -> Task 2 -> Task 5
var path125 = new Dictionary<string, object> { ["ChosenPipe"] = "Task 2" };
pipeLine.Run(path125);
// Runs Task 1 -> Task 3 -> Task 5
var path135 = new Dictionary<string, object> { ["ChosenPipe"] = "Task 3" };
pipeLine.Run(path135);
// Runs Task 1 -> Task 4 -> Task 5
var path145 = new Dictionary<string, object> { ["ChosenPipe"] = "Task 4" };
pipeLine.Run(path145);
Product | Versions 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.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.
Defined pipes with input and output key interfaces.