没有任何东西可以在同样的东西中定义

时间:2017-03-05 11:04:29

标签: scala akka akka-stream

也似乎没有为我工作。物品不会在其中定义下沉。这就是我所拥有的。

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。我错过了什么?

1 个答案:

答案 0 :(得分:1)

原告问题与alsoTo无关。问题是使用Source.fromPublisher创建的接收器。我错误地认为我可以使用相同的Publisher[T]创建多个接收器。因为已经有另一个水槽,所以没有用。