scala - RoundRobinPool 和 RoundRobinRouter 有什么区别

标签 scala akka

这是我见过的两种用法:

context.actorOf(Props(new IndexWorker(props)).withRouter(RoundRobinRouter(4)))

context.actorOf(RoundRobinPool(4).props(Props[FileExplorer]))

这两种用法有什么区别?

最佳答案

RoundRobinRouter 已弃用

@deprecated("Use RoundRobinPool or RoundRobinGroup", "2.3")

akka documentation中有一个关于路由器差异的部分。 :

This type of router actor comes in two distinct flavors:

Pool - The router creates routees as child actors and removes them from the router if they terminate.

Group - The routee actors are created externally to the router and the router sends messages to the specified path using actor selection, without watching for termination.

关于scala - RoundRobinPool 和 RoundRobinRouter 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35262653/

相关文章:

java - 实现事件驱动的轻量级线程

scala - 为什么 akka-http Unmarshaler 返回 Future[T] 而不是 T?

scala:检索用于以可继承方式构造类实例的参数?

scala - Spark : Explode a dataframe array of structs and append id

Scala 实例变量最佳实践

scala - Play Framework、REST、路由和 Controller

akka - 与 Akka 的跨服务调用

java - Akka-Java 路由问题

scala - 如何在scaladoc中转义/*?