0
是否有更好的方法來實現下面的方法(即通過去除Materializer
約束。):收集水槽物化值作爲源
import akka.NotUsed
import akka.stream.Materializer
import akka.stream.scaladsl.{Keep, Sink, Source}
def assemble[A, B, C](source: Source[A, NotUsed])
(f: A => Source[B, NotUsed], g: A => Sink[B, C])
(implicit m: Materializer): Source[C, NotUsed] = {
source.map(a => f(a).toMat(g(a))(Keep.right).run())
}
?