Sink.lastOption

Materialize a Future[Option[T]] CompletionStage<Optional<T>> which completes with the last value emitted wrapped in an Some Optional when the stream completes.

Sink operators

Signature

def lastOption[T]: Sink[T, Future[Option[T]]]

Description

Materialize a Future[Option[T]] CompletionStage<Optional<T>> which completes with the last value emitted wrapped in an Some Optional when the stream completes. if the stream completes with no elements the CompletionStage is completed with None an empty Optional.

cancels never

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.