0
我的系统在Play framework 2.5和Akka内置模式下运行。我相信有两种方法来初始化路由器。初始化Akka路由器的两种方式之间的区别
1:
ActorRef router = akkaService.getActorSystem()
.actorOf(new RoundRobinPool(poolSize)
.props(Props.create(ProfileActor.class)), "ProfileActor");
2:
ActorRef router = akkaService.getActorSystem()
.actorOf(new Props(ProfileActor.class)
.withRouter(new RoundRobinRouter(poolSize)), "ProfileActor"));
所以我有2个问题:
- 它们有什么不同?
- 哪种方式更好?
非常感谢!