maybe

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

Source operators

Signature

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

Description

Materialize a Promise[Option[T]] that if completed with a Some[T] will emit that T and then complete the stream, or if completed with None 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.