trustmaster / goflow

Flow-based and dataflow programming library for Go (golang)
MIT License
1.61k stars 125 forks source link

adds the ability for a component to have multiple clients on an out channel #14

Closed davidkbainbridge closed 11 years ago

davidkbainbridge commented 11 years ago

If a component has a slice for an "out" channel, then more than one other component can be connected to the channel and on each connect a new channel instance will be created and the two components will be connected.

It is left up to the component to select which "out" channel is used.

The idea is this can be seen as the base work for load balancing components or even broadcast components.

I suspect, that a "Selector" interface should be introduced to allow a "pick one of" capability, which could then use different strategies to select an output channel. The test added demonstrates a very simple round robin strategy without using such an interface.