head

Materializes into a Future CompletionStage which completes with the first value arriving, after this the stream is canceled.

Sink operators

Signature

def head[T]: Sink[T, Future[T]]

Description

Materializes into a Future CompletionStage which completes with the first value arriving, after this the stream is canceled. If no element is emitted, the Future CompletionStage is failed.

Reactive Streams semantics

cancels after receiving one element

backpressures never

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.