4 ms·
It's really the code to connect the stages. I want to support 1->many, so a single stage can fan out it's output to multiple consumers. The code which wants to
by jbert 12y ago
It's really the code to connect the stages. I want to support 1->many, so a single stage can fan out it's output to multiple consumers.
The code which wants to be generic is in the handling of things like setting up channels between stages, handling data passing between them and cancellation (shutdown).
I also want to support a layer of abstraction, where I can compose a graph of stages into a single stage.
The goal is to have a number of primitive processing stages and allow abstraction and composition to build more complex processing.
Basically I could move to a pure interface and associated functions (not methods). That would perhaps be more idiomatic go. It's just a slight shame that a bunch of code which lives to my mind slightly more naturally as a set of methods on a type gets promoted to top-level package functions due to the inabillity to define methods on an interface. But that's probably OK.