Settings are the overall ActorSystem Settings which also provides a convenient access to the Config object. For more detailed information about the different possible configuration options, look in the Akka .NET Documentation under "Configuration"
コード例 #1
0
ファイル: Deployer.cs プロジェクト: ClusterReply/akka.net
 public Deployer(Settings settings)
 {
     _settings = settings;
     _deployment = settings.Config.GetConfig("akka.actor.deployment");
     _default = _deployment.GetConfig("default");
     Init();
 }
コード例 #2
0
 /// <summary>
 /// Default constructor...
 /// </summary>
 public DefaultDispatcherPrerequisites(EventStream eventStream, IScheduler scheduler, Settings settings, Mailboxes mailboxes)
 {
     Mailboxes = mailboxes;
     Settings = settings;
     Scheduler = scheduler;
     EventStream = eventStream;
 }
コード例 #3
0
 public ClusterActorRefProvider(string systemName, Settings settings, EventStream eventStream /*DynamicAccess*/)
     : base(systemName, settings, eventStream)
 {
     var clusterConfig = ClusterConfigFactory.Default();
     settings.InjectTopLevelFallback(clusterConfig);
     Deployer = new ClusterDeployer(settings);
 }
コード例 #4
0
ファイル: Deployer.cs プロジェクト: rodrigovidal/akka.net
        public Deployer(Settings settings)
        {
            _settings = settings;
            var config = settings.Config.GetConfig("akka.actor.deployment");
            _default = config.GetConfig("default");

            var rootObj = config.Root.GetObject();
            if (rootObj == null) return;
            var unwrapped = rootObj.Unwrapped.Where(d => !d.Key.Equals("default")).ToArray();
            foreach (var d in unwrapped.Select(x => ParseConfig(x.Key, config.GetConfig(x.Key))))
            {
                SetDeploy(d);
            }
        }
コード例 #5
0
        public LocalActorRefProvider(string systemName, Settings settings, EventStream eventStream, Deployer deployer, Func<ActorPath, InternalActorRef> deadLettersFactory)
        {
            _settings = settings;
            _eventStream = eventStream;
            _deployer = deployer ?? new Deployer(settings);
            _rootPath = new RootActorPath(new Address("akka", systemName));
            _log = Logging.GetLogger(eventStream, "LocalActorRefProvider(" + _rootPath.Address + ")");
            if (deadLettersFactory == null)
                deadLettersFactory = p => new DeadLetterActorRef(this, p, _eventStream);
            _deadLetters = deadLettersFactory(_rootPath / "deadLetters");
            _tempNumber = new AtomicCounterLong(1);
            _tempNode = _rootPath / "temp";

            //TODO: _guardianSupervisorStrategyConfigurator = dynamicAccess.createInstanceFor[SupervisorStrategyConfigurator](settings.SupervisorStrategyClass, EmptyImmutableSeq).get
            _systemGuardianStrategy = SupervisorStrategy.DefaultStrategy;

        }
コード例 #6
0
ファイル: MailboxesSpec.cs プロジェクト: Micha-kun/akka.net
 public IntPriorityMailbox(Settings settings, Config config) : base(settings, config)
 {
 }
コード例 #7
0
ファイル: TaskManager.cs プロジェクト: BhpDevGroup/BhpAll
 public TaskManagerMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
 }
コード例 #8
0
 public ConsensusServiceMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
 }
コード例 #9
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="systemName">TBD</param>
 /// <param name="settings">TBD</param>
 /// <param name="eventStream">TBD</param>
 public LocalActorRefProvider(string systemName, Settings settings, EventStream eventStream)
     : this(systemName, settings, eventStream, null, null)
 {
     //Intentionally left blank
 }
コード例 #10
0
 public BoundedMessageQueue(Settings settings, Config config) 
     : this(config.GetInt("mailbox-capacity"), config.GetTimeSpan("mailbox-push-timeout-time"))
 {
 }
コード例 #11
0
 public LocalActorRefProvider(string systemName, Settings settings, EventStream eventStream)
     : this(systemName, settings, eventStream, null, null)
 {
     //Intentionally left blank
 }
コード例 #12
0
 public ClusterDeployer(Settings settings)
     : base(settings)
 {
 }
コード例 #13
0
 public PriorityMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
 }
コード例 #14
0
ファイル: Deployer.cs プロジェクト: Badmoonz/akka.net
 public Deployer(Settings settings)
 {
     this.settings = settings;
     deployment = settings.Config.GetConfig("akka.actor.deployment");
     @default = deployment.GetConfig("default");
 }
コード例 #15
0
ファイル: ProtocolHandler.cs プロジェクト: ZoroChain/Zoro
 public ProtocolHandlerMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
     InitMessageFlags();
 }
コード例 #16
0
ファイル: RemoteNode.cs プロジェクト: krona-project/krona
 public RemoteNodeMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
 }
コード例 #17
0
 public RemoteDeployer(Settings settings) : base(settings)
 {
 }
コード例 #18
0
ファイル: Blockchain.cs プロジェクト: sshyran/neo
 public BlockchainMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
 }
コード例 #19
0
        public LocalActorRefProvider(string systemName, Settings settings, EventStream eventStream, Deployer deployer, Func<ActorPath, IInternalActorRef> deadLettersFactory)
        {
            _settings = settings;
            _eventStream = eventStream;
            _deployer = deployer ?? new Deployer(settings);
            _rootPath = new RootActorPath(new Address("akka", systemName));
            _log = Logging.GetLogger(eventStream, "LocalActorRefProvider(" + _rootPath.Address + ")");
            if(deadLettersFactory == null)
                deadLettersFactory = p => new DeadLetterActorRef(this, p, _eventStream);
            _deadLetters = deadLettersFactory(_rootPath / "deadLetters");
            _tempNumber = new AtomicCounterLong(1);
            _tempNode = _rootPath / "temp";

            _systemGuardianStrategy = SupervisorStrategy.DefaultStrategy;
            _userGuardianStrategyConfigurator = SupervisorStrategyConfigurator.CreateConfigurator(Settings.SupervisorStrategyClass);
        }
コード例 #20
0
 public ProtocolHandlerMailbox(Akka.Actor.Settings settings, Config config)
     : base(settings, config)
 {
 }
コード例 #21
0
ファイル: AkkaIOTransport.cs プロジェクト: Micha-kun/akka.net
 public AkkaIOTransport(ActorSystem system, Config config)
 {
     _settings = new Settings(config);
     _manager = system.ActorOf(Props.Create(() => new TransportManager()), "IO-TRANSPORT");
 }
コード例 #22
0
        protected internal override void OnStart(string[] args)
        {
            bool useRPC = false;

            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i])
                {
                case "/rpc":
                case "--rpc":
                case "-r":
                    useRPC = true;
                    break;

                case "/testnet":
                case "--testnet":
                case "-t":
                    ProtocolSettings.Initialize(new ConfigurationBuilder().AddJsonFile("protocol.testnet.json").Build());
                    Settings.Initialize(new ConfigurationBuilder().AddJsonFile("config.testnet.json").Build());
                    break;

                case "/mainnet":
                case "--mainnet":
                case "-m":
                    ProtocolSettings.Initialize(new ConfigurationBuilder().AddJsonFile("protocol.mainnet.json").Build());
                    Settings.Initialize(new ConfigurationBuilder().AddJsonFile("config.mainnet.json").Build());
                    break;
                }
            }
            store  = new LevelDBStore(Path.GetFullPath(Settings.Default.Paths.Chain));
            system = new TrustlinkSystem(store);
            system.StartNode(new ChannelsConfig
            {
                Tcp                      = new IPEndPoint(IPAddress.Any, Settings.Default.P2P.Port),
                WebSocket                = new IPEndPoint(IPAddress.Any, Settings.Default.P2P.WsPort),
                MinDesiredConnections    = Settings.Default.P2P.MinDesiredConnections,
                MaxConnections           = Settings.Default.P2P.MaxConnections,
                MaxConnectionsPerAddress = Settings.Default.P2P.MaxConnectionsPerAddress
            });
            if (Settings.Default.UnlockWallet.IsActive)
            {
                try
                {
                    Program.Wallet = OpenWallet(Settings.Default.UnlockWallet.Path, Settings.Default.UnlockWallet.Password);
                }
                catch (CryptographicException)
                {
                    Console.WriteLine($"failed to open file \"{Settings.Default.UnlockWallet.Path}\"");
                }
                if (Settings.Default.UnlockWallet.StartConsensus && Program.Wallet != null)
                {
                    OnStartConsensusCommand(null);
                }
            }
            if (useRPC)
            {
                system.StartRpc(Settings.Default.RPC.BindAddress,
                                Settings.Default.RPC.Port,
                                wallet: Program.Wallet,
                                sslCert: Settings.Default.RPC.SslCert,
                                password: Settings.Default.RPC.SslCertPassword,
                                maxLinkInvoke: Settings.Default.RPC.MaxLINKInvoke);
            }
        }