outputwhich
Outputwhich is a term used in computing to describe a construct for routing outputs from a processing unit to multiple destinations according to a set of selection criteria. It functions as a demultiplexing or routing operator that, for each input item, evaluates a selector and dispatches the item to the corresponding output channel. The name combines "output" with "which," signaling that the mechanism decides which output is used.
Origin and scope: The term is not standardized and appears primarily in experimental programming libraries and
Concept and mechanics: An outputwhich construct typically takes two elements: a mapping from criteria or predicates
Typical use cases: Event routing in stream processing, log routing by severity, data transformation pipelines where
Example: Define routes = { level >= 5 -> fileSink, isAlert -> alertService, otherwise -> console }. For each record r, outputwhich(r,
See also: demultiplexer, routing, fan-out, predicate-based routing, data pipeline.