也似乎没有为我工作。物品不会在其中定义下沉。这就是我所拥有的。
val merged: Source[ArticleWithKeywords, _] = ...
val (ks, fut) = merged
.alsoTo(Flow[ArticleWithKeywords].map { a => a.id -> a.ids.toList }.to(queueManager.getIdsForAnsSink))
.map(_.id)
.groupedWithin(100, 5 seconds)
.mapAsync(4) { ids => runReferenceFetching(ids) }
.viaMat(KillSwitches.single)(Keep.right)
.toMat(Sink.ignore)(Keep.both)
.run()
但是我看到项目达到了runReferenceFetching。我错过了什么?
答案 0 :(得分:1)
原告问题与alsoTo
无关。问题是使用Source.fromPublisher
创建的接收器。我错误地认为我可以使用相同的Publisher[T]
创建多个接收器。因为已经有另一个水槽,所以没有用。