Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

Latest commit

 

History

History
61 lines (44 loc) · 1.72 KB

Pipelines.md

File metadata and controls

61 lines (44 loc) · 1.72 KB

Pipelines

Contents

Creating Pipelines

Basic pipelines

Let's say you have the following line of code:

var result = long.Parse(age);

snippet source / anchor

You can refactor this to pipelines with the following

var inputPipe = new InputPipe<string>("age");
var parsePipe = inputPipe.ProcessFunction(long.Parse);
var collector = parsePipe.Collect();

inputPipe.Send("42");
var result = collector.SingleResult;

snippet source / anchor

These will produce the same results.

But Why?!?!

Despite the complexity add of this code, this pattern has some advantages in refactoring to async as well has advantages in monitoring. It also has advantages in testing and visualization. For example the pipeline can render itself as the following dot file (Graphviz)

GraphViz of Pipeline

Actions

Joins, ApplyTo, Concate