Class ConnectedStreams<IN1,​IN2>

  • Type Parameters:
    IN1 - Type of the first input data steam.
    IN2 - Type of the second input data stream.

    @Public
    public class ConnectedStreams<IN1,​IN2>
    extends Object
    ConnectedStreams represent two connected streams of (possibly) different data types. Connected streams are useful for cases where operations on one stream directly affect the operations on the other stream, usually via shared state between the streams.

    An example for the use of connected streams would be to apply rules that change over time onto another stream. One of the connected streams has the rules, the other stream the elements to apply the rules to. The operation on the connected stream maintains the current set of rules in the state. It may receive either a rule update and update the state or a data element and apply the rules in the state to the element.

    The connected stream can be conceptually viewed as a union stream of an Either type, that holds either the first stream's type or the second stream's type.