Sink.reduce

Apply a reduction function on the incoming elements and pass the result to the next invocation.

Sink operators

Signature

def reduce[T](f: (T, T) ⇒ T): Sink[T, Future[T]]

Description

Apply a reduction function on the incoming elements and pass the result to the next invocation. The first invocation receives the two first elements of the flow.

Materializes into a Future CompletionStage that will be completed by the last result of the reduction function.

cancels never

backpressures when the previous reduction function invocation has not yet completed

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.