Flow.lazyInitAsync
Creates a real Flow
upon receiving the first element by calling relevant flowFactory
given as an argument.
Signature
def lazyInitAsync[I, O, M](flowFactory: () => Future[Flow[I, O, M]]): Flow[I, O, Future[Option[M]]]
Description
Creates a real Flow
upon receiving the first element by calling relevant flowFactory
given as an argument. Internal Flow
will not be created if there are no elements, because of completion or error. The materialized value of the Flow
will be the materialized value of the created internal flow.
The materialized value of the Flow
is a Future[Option[M]]
that is completed with Some(mat)
when the internal flow gets materialized or with None
when there where no elements. If the flow materialization (including the call of the flowFactory
) fails then the future is completed with a failure.
Adheres to the `ActorAttributes.SupervisionStrategy`
attribute.
emits when the internal flow is successfully created and it emits
backpressures when the internal flow is successfully created and it backpressures
completes when upstream completes and all elements have been emitted from the internal flow
completes when upstream completes and all futures have been completed and all elements have been emitted