extrapolate

Allow for a faster downstream by expanding the last emitted element to an Iterator.

Backpressure aware operators

Signature

def extrapolate[U >: Out](extrapolator: U ⇒ Iterator[U], initial: Option[U] = None): Repr[U]

Description

Allow for a faster downstream by expanding the last emitted element to an Iterator. For example, an Iterator.continually(element) will cause extrapolate to keep repeating the last emitted element.

All original elements are always emitted unchanged - the Iterator is only used whenever there is downstream demand before upstream emits a new element.

Includes an optional initial argument to prevent blocking the entire stream when there are multiple producers.

See Understanding extrapolate and expand for more information and examples.

emits when downstream stops backpressuring

backpressures when downstream backpressures

completes when upstream completes

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.