trustmaster / goflow

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

Sync mode of components with multiple inputs #17

Closed trustmaster closed 10 years ago

trustmaster commented 10 years ago

Currently sync mode only affects components with a single input. Multiple inputs are processed in separate goroutines, so they are still async to each other.

Enforcing a StateLock mutex on all sync components would fix data races, but it wouldn't fix the "events order" problem, i.e. it doesn't guarantee the correct sequence of invocation.

It could be fixed by using a traditional Go's switch on multiple channels, but it is impossible because the list of channel variables isn't predefined.