Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
scala中的参与者引用_Scala_Akka_Actor_Akka.net_Actor Model - Fatal编程技术网

scala中的参与者引用

scala中的参与者引用,scala,akka,actor,akka.net,actor-model,Scala,Akka,Actor,Akka.net,Actor Model,/user/master/“+startID和/user/master/*之间有什么区别? 我假设*意味着StartRouteProcess消息将发送给所有参与者。这是正确的吗? 鉴于,/user/master/“+startID使用给定的startID case JoinNode => val startID = Nodelist(Random.nextInt(numJoined)) context.system.actorSelection(

/user/master/“+startID
/user/master/*
之间有什么区别? 我假设*意味着
StartRouteProcess
消息将发送给所有参与者。这是正确的吗? 鉴于,
/user/master/“+startID
使用给定的
startID

      case JoinNode =>
        val startID = Nodelist(Random.nextInt(numJoined))
        context.system.actorSelection("/user/master/" + startID) ! Task("Join", startID, Nodelist(numJoined), -1)

      case BeginRouting =>
        println("Node Join Finished.\n")
        println("Routing started.")
        context.system.actorSelection("/user/master/*") ! StartRouteProcess

根据akka文件:

可以使用ActorSystem.actorSelection和ActorContext.actorSelection方法制定选择,并且不支持发送消息:

context.actorSelection(“../*”)!msg

将向包括当前参与者在内的所有同级发送消息


所以你是对的。

根据akka文件:

可以使用ActorSystem.actorSelection和ActorContext.actorSelection方法制定选择,并且不支持发送消息:

context.actorSelection(“../*”)!msg

将向包括当前参与者在内的所有同级发送消息

所以你是对的