NetPipe 0.9.2
See the version list below for details.
dotnet add package NetPipe --version 0.9.2
NuGet\Install-Package NetPipe -Version 0.9.2
<PackageReference Include="NetPipe" Version="0.9.2" />
paket add NetPipe --version 0.9.2
#r "nuget: NetPipe, 0.9.2"
// Install NetPipe as a Cake Addin #addin nuget:?package=NetPipe&version=0.9.2 // Install NetPipe as a Cake Tool #tool nuget:?package=NetPipe&version=0.9.2
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. |
-
.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.
- Added Skip capability to the BeforePipeEvent.
- Fixed 'first connector won't run bug'
- Added helper methods to PipeLineRunner to register events.