I would like to see some generic functions to construct my own pipeline functions. In concept, it might look like:
import "github.com/msacore/pipe/builder"
...
fn := builder.
WithInputs(in1, in2).
WithOutputs(out1, out2).
WithCloser(closer.Some). // const
WithCapacity(capacity.Same). // const
WithStrategy(strategy.Parallel). // func
WithHandler(???).
Build(ctx)
...
func Split(...) {
return fn(...)
}
Of course, we need some more research about how to implement and use different atomic strategies with atomic handlers. I mean, how the handler should work and the Builder should understand for different functions like Split and Merge for example.
These functions have conceptually different algorithms where Split just waits for a single input, and Merge waits for all inputs.
I guess, this problem can be solved with different handler functions builder, like WithHandlerAll and WithHandlerSome and WithHandlerSingle (specific case of WithHandlerAll)