打算从 issues 入手读 akka 源码, 给 stream operator 写写文档示例,
lazy source
的描述:
/**
* Defers invoking the `create` function to create a future source until there is downstream demand.
*
* The returned source will emit downstream and behave just like it was the outer source. Downstream completes
* when the created source completes and fails when the created source fails.
*
* Note that asynchronous boundaries (and other operators) in the stream may do pre-fetching which counter acts
* the laziness and will trigger the factory immediately.
*
* The materialized future value is completed with the materialized value of the created source when
* it has been materialized. If the function throws or the source materialization fails the future materialized value
* is failed with the thrown exception.
*
* If downstream cancels or fails before the function is invoked the materialized value
* is failed with a [[akka.stream.NeverMaterializedException]]
*/
def lazySource[T, M](create: () => Source[T, M]): Source[T, Future[M]] =
请教下 v 友什么场景会使用到lazy source
啊, 实在想不到