Create() public static method

Create settings from the default configuration "akka.cluster.client.receptionist".
public static Create ( ActorSystem system ) : ClusterReceptionistSettings
system ActorSystem
return ClusterReceptionistSettings
示例#1
0
        private IActorRef CreateReceptionist(Config config)
        {
            if (IsTerminated)
            {
                return(_system.DeadLetters);
            }
            else
            {
                var name       = config.GetString("name");
                var dispatcher = config.GetString("use-dispatcher");
                if (string.IsNullOrEmpty(dispatcher))
                {
                    dispatcher = Dispatchers.DefaultDispatcherId;
                }

                // important to use val mediator here to activate it outside of ClusterReceptionist constructor
                var mediator = PubSubMediator;
                return(_system.SystemActorOf(ClusterReceptionist.Props(mediator, ClusterReceptionistSettings.Create(config)).WithDispatcher(dispatcher), name));
            }
        }