BasicCluster.Program.InitClusterNode C# (CSharp) Метод

InitClusterNode() приватный статический Метод

private static InitClusterNode ( ClusterNode node ) : void
node ClusterNode
Результат void
        private static void InitClusterNode(ClusterNode node)
        {
            node.RootActors = new List<IActorRef>();
            foreach (var role in node.Roles)
            {
                IActorRef rootActor;
                switch (role)
                {
                    case "producer":
                        rootActor = node.Context.System.ActorOf(Props.Create(() => new EchoProducerActor(node.Context)));
                        break;

                    case "consumer":
                        rootActor = node.Context.System.ActorOf(Props.Create(() => new EchoConsumerActor(node.Context)));
                        break;

                    default:
                        throw new InvalidOperationException("Invalid role: " + role);
                }
                node.RootActors.Add(rootActor);
            }
        }