zipLatestWith

Combines elements from multiple sources through a combine function and passes the returned value downstream, picking always the latest element of each.

Fan-in operators

Signature

def zipLatestWith[Out2, Out3](that: Graph[SourceShape[Out2], _])(combine: (Out, Out2) ⇒ Out3): Repr[Out3]
def zipLatestWithMat[Out2, Out3, Mat2, Mat3](that: Graph[SourceShape[Out2], Mat2])(combine: (Out, Out2) ⇒ Out3)(matF: (Mat, Mat2) ⇒ Mat3): ReprMat[Out3, Mat3]

Description

Combines elements from each of multiple sources into tuples Pair and passes the tuples pairs downstream, picking always the latest element of each.

No element is emitted until at least one element from each Source becomes available. Whenever a new element appears, the zipping function is invoked with a tuple containing the new element and the last seen element of the other stream.

emits all of the inputs have at least an element available, and then each time an element becomes available on either of the inputs

backpressures when downstream backpressures

completes when any upstream completes

cancels when downstream cancels

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.