Description
This issue was introduced on the Google group - https://groups.google.com/forum/#!topic/flow-based-programming/NaYix1I81QM . I am reproducing the discussion here.
@jpaulm (Aug.1, 2015)
I recently realized there was a problem when substreams were being sent through a LoadBalance process: the components of the substream (open brackets, data IPs, and close bracket) could theoretically be sent to different output port array elements, resulting in the substream getting disassembled.
I have therefore modified LoadBalance to route all components of a substream to the same output port array element. This code is now on GitHub - I will be doing some testing, but I would appreciate it if anyone using substreams and LoadBalance, preferably with large data volumes could also check it out.
@jpaulm (Aug. 13, 2015)
BTW before I go on, it should be stressed that this is in the context of "classical" FBP, as implemented by JavaFBP, C#FBP, CppFBP (and perhaps JSFBP). The mod to LoadBalance has only been actually implemented in JavaFBP so far, and in view of the problem I am going to describe, it seems I only did half the job anyway! I have no idea if NoFlo and similar FBP-like systems have an analogous problem.
Let us say that we have used the (modified) LoadBalance component to route whole substreams to the various output port elements of LoadBalance - the split streams will most likely have to be recombined at some point. Now we can't use something like a round robin merge to bring them back into one stream, as that would introduce the possibility of deadlocks. So we need some way of bringing them into a single input port - but the default "first come, first served" merge into one port would mix up the substreams, so I am proposing a new API call which allows a component to wait on any element of an input array port, and return the element number at which there is a data IP waiting. This function will suspend until an IP arrives at one of the array port elements.