maybe

Materialize a Promise[Option[T]] CompletionStage that if completed with a Some[T] Optional will emit that T and then complete the stream, or if completed with None empty Optional complete the stream right away.

Source stages

Signature

def maybe[T]: Source[T, Promise[Option[T]]]

Description

Materialize a Promise[Option[T]] CompletionStage that if completed with a Some[T] Optional will emit that T and then complete the stream, or if completed with None empty Optional complete the stream right away.

emits when the returned promise is completed with some value

completes after emitting some value, or directly if the promise is completed with no value

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.