Any vs. All
This lists some arguments for triggering components when any input ports have data (Java FBP) vs. when all input ports have data (FlowBase - DavidBennett's implementation).
A corollary of this is that, under the all protocol, a component is not reinvoked on exit if any input ports are drained.
Under the all protocol, some behaviours characteristic of "traditional" FBP have to be enabled using additional component flags.
Pro All (Con Any)
- Perhaps more intuitive than any, as there is a feeling that a component should not start until all the data is available. However, there are significant disadvantages - see e.g. the remarks about Collate below.
- Where all really does make a lot of sense is in the case of multiple input port non-loopers. However, even in this case, under the any protocol, such a component would simply wait until data arrives at the non-triggering port. And this case is so rare in practice that, in my opinion, it does not make sense to make the tail wag the dog.
Pro Any (Con All)
- Greater propensity to deadlock in the all case: consider a Collate, where the "masters" input stream may contain many IPs before the first "detail" arrives. Under the all protocol, this component will have to be marked with a special flag to force it to start when the first data item arrives at any port (or earlier), as otherwise the masters input connection will most likely fill up before a detail arrives, resulting in deadlock. But this is actually the normal case for loopers with more than one input port, so it seems counterintuitive that the "normal" case is the one that needs to be marked.
- As a component will terminate when the first input port is drained (the port is empty and all its upstream components terminated), this may leave IPs still coming in on other input ports. Since the component in question will have terminated, this situation could also result in deadlocks. This again has to be countered by using still another component flag (or the same one). Again it seems counterintuitive that the "normal" case is the one that needs to be marked.
- For what it's worth, components in TomYoung's DFD system wait on a single port(usually) for data and trigger when that data is available. A few special components, such as Join, are written to trigger whenever data is available at any of a selected list of ports (multiplexing). So in the case of the DFD, the question is not 'Any' vs. 'All', but instead is what is required for the application. Join can combine any number of inputs, so no other multiplexing logic is required in any other component. --twy