Akka.Cluster.Tools.Client.ClusterReceptionistSettings.Create C# (CSharp) Метод

Create() публичный статический Метод

Create settings from the default configuration "akka.cluster.client.receptionist".
public static Create ( ActorSystem system ) : ClusterReceptionistSettings
system ActorSystem
Результат ClusterReceptionistSettings
        public static ClusterReceptionistSettings Create(ActorSystem system)
        {
            var config = system.Settings.Config.GetConfig("akka.cluster.client.receptionist");
            if (config == null)
                throw new ArgumentException(string.Format("Actor system [{0}] doesn't have `akka.cluster.client.receptionist` config set up", system.Name));

            return Create(config);
        }

Same methods

ClusterReceptionistSettings::Create ( Config config ) : ClusterReceptionistSettings

Usage Example

Пример #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));
            }
        }