Class DeclaringAsyncKeyedCoProcessFunction<K,​IN1,​IN2,​OUT>

  • Type Parameters:
    K - Type of the key.
    IN1 - Type of the first input.
    IN2 - Type of the second input.
    OUT - Output type.
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction

    @Internal
    public abstract class DeclaringAsyncKeyedCoProcessFunction<K,​IN1,​IN2,​OUT>
    extends KeyedCoProcessFunction<K,​IN1,​IN2,​OUT>
    A function that processes elements of two keyed streams and produces a single output stream.

    The function will be called for every element in the input streams and can produce zero or more output elements. Contrary to the CoFlatMapFunction, this function can also query the time (both event and processing) and set timers, through the provided KeyedCoProcessFunction.Context. When reacting to the firing of timers the function can emit yet more elements.

    An example use case for connected streams is the application of a set of rules that change over time (stream A) to the elements contained in another stream (stream B). The rules contained in stream A can be stored in the state and wait for new elements to arrive on stream B. Upon reception of a new element on stream B, the function can apply the previously stored rules to the element and emit a result, and/or register a timer that will trigger an action in the future.

    See Also:
    Serialized Form