2017-06-25 6 views

答えて

2

あなたが同じ場所にグラフ全体をrun()したい場合は、ちょうどあなたがあなたの「グループ+倍」シンクを再利用する必要がある場合は、あなたがソースを取り除く必要があるtoMat + Keep.right

val result: Future[Int] = 
    MergeHub.source[Int].grouped(100).toMat(Sink.fold(0) { case (count, items) => count + items.sum })(Keep.right).run() 

を使用し、 runコール

docs
val sink: Sink[Int, Future[Int]] = 
    Flow[Int].grouped(100).toMat(Sink.fold(0) { case (count, items) => count + items.sum })(Keep.right) 

詳細情報。

関連する問題