然后集群化的group router使用起来也很方便,再就是集群分片cluster-sharding了。下面我们就通过一个例子来介绍cluster-sharding的具体使用方法。...首先,分片的意思是指在集群中多个节点上部署某种actor,即entity,的构建机制。...entity的构建是动态的,ClusterSharding系统根据各节点的负载情况决定到底在哪个节点构建entity,然后返回ShardRegion:一个该类entity具体的构建工具及消息中介。...Entity(createBehavior, typeKey, None, Props.empty, None, None, None, None, None)
}
这个函数需要一个EntityTyeKey和一个构建...ActorSystem[EntityManager.Command](EntityManager(), "ClusterSystem", config)
...
}
一共设定了3个role=shard节点和1