当前位置: 首页>>代码示例>>C#>>正文


C# Config.GetStringList方法代码示例

本文整理汇总了C#中Akka.Configuration.Config.GetStringList方法的典型用法代码示例。如果您正苦于以下问题:C# Config.GetStringList方法的具体用法?C# Config.GetStringList怎么用?C# Config.GetStringList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Akka.Configuration.Config的用法示例。


在下文中一共展示了Config.GetStringList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configure

        /// <summary>
        /// Performs configuration
        /// </summary>
        /// <param name="configuration">Previous configuration</param>
        /// <param name="config">Akka configuration</param>
        /// <returns>Updated configuration</returns>
        public LoggerConfiguration Configure(LoggerConfiguration configuration, Config config)
        {
            var minimumLevel = config.GetString("ClusterKit.Log.ElasticSearch.minimumLevel", "none")?.Trim();

            LogEventLevel level;
            if (!Enum.TryParse(minimumLevel, true, out level))
            {
                return configuration;
            }

            var nodes = config.GetStringList("ClusterKit.Log.ElasticSearch.nodes");

            var indexFormat = config.GetString("ClusterKit.Log.ElasticSearch.indexFormat", "logstash-{0:yyyy.MM.dd}");

            Log.Information(
                "{Type}: \n\tMinimum level: {MinimumLevel}\n\tIndex format: {IndexFormat}\n\tNodes:\n\t\t{NodeList}\n",
                this.GetType().FullName,
                minimumLevel,
                indexFormat,
                string.Join("\n\t\t", nodes));


            SelfLog.Enable(Console.WriteLine);
            var options = new ElasticsearchSinkOptions(nodes.Select(s => new Uri(s)))
                              {
                                  MinimumLogEventLevel = level,
                                  AutoRegisterTemplate = true,
                                  IndexFormat = indexFormat
                              };

            return configuration.WriteTo.Elasticsearch(options);


        }
开发者ID:kantora,项目名称:ClusterKit,代码行数:40,代码来源:Configurator.cs

示例2: RemoteSettings

 public RemoteSettings(Config config)
 {
     Config = config;
     LogReceive = config.GetBoolean("akka.remote.log-received-messages");
     LogSend = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
     if (RemoteLifecycleEventsLogLevel.Equals("on")) RemoteLifecycleEventsLogLevel = "DEBUG";
     FlushWait = config.GetMillisDuration("akka.remote.flush-wait-on-shutdown");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames = config.GetStringList("akka.remote.enabled-transports");
     Transports = (from transportName in TransportNames
         let transportConfig = TransportConfigFor(transportName)
         select new TransportSettings(transportConfig)).ToArray();
     Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));
     BackoffPeriod = config.GetMillisDuration("akka.remote.backoff-interval");
     RetryGateClosedFor = config.GetMillisDuration("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
     UsePassiveConnections = config.GetBoolean("akka.remote.use-passive-connections");
     SysMsgBufferSize = config.GetInt("akka.remote.system-message-buffer-size");
     SysResendTimeout = config.GetMillisDuration("akka.remote.resend-interval");
     InitialSysMsgDeliveryTimeout = config.GetMillisDuration("akka.remote.initial-system-message-delivery-timeout");
     SysMsgAckTimeout = config.GetMillisDuration("akka.remote.system-message-ack-piggyback-timeout");
     QuarantineDuration = config.GetMillisDuration("akka.remote.prune-quarantine-marker-after");
     StartupTimeout = config.GetMillisDuration("akka.remote.startup-timeout");
     CommandAckTimeout = config.GetMillisDuration("akka.remote.command-ack-timeout");
 }
开发者ID:jweimann,项目名称:akka.net,代码行数:27,代码来源:RemoteSettings.cs

示例3: RemoteSettings

 public RemoteSettings(Config config)
 {
     Config = config;
     LogReceive = config.GetBoolean("akka.remote.log-received-messages");
     LogSend = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames = config.GetStringList("akka.remote.enabled-transports");
     Transports = (from transportName in TransportNames
         let transportConfig = TransportConfigFor(transportName)
         select new TransportSettings(transportConfig)).ToArray();
 }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:14,代码来源:RemoteSettings.cs

示例4: RemoteSettings

        public RemoteSettings(Config config)
        {
            //TODO: need to add value validation for each field
            Config = config;
            LogReceive = config.GetBoolean("akka.remote.log-received-messages");
            LogSend = config.GetBoolean("akka.remote.log-sent-messages");

            var bufferSizeLogKey = "akka.remote.log-buffer-size-exceeding";
            if (config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("off") ||
                config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("false"))
            {
                LogBufferSizeExceeding = Int32.MaxValue;
            }
            else
            {
                LogBufferSizeExceeding = config.GetInt(bufferSizeLogKey);
            }

            UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
            TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
            RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
            Dispatcher = config.GetString("akka.remote.use-dispatcher");
            if (RemoteLifecycleEventsLogLevel.Equals("on", StringComparison.OrdinalIgnoreCase)) RemoteLifecycleEventsLogLevel = "DEBUG";
            FlushWait = config.GetTimeSpan("akka.remote.flush-wait-on-shutdown");
            ShutdownTimeout = config.GetTimeSpan("akka.remote.shutdown-timeout");
            TransportNames = config.GetStringList("akka.remote.enabled-transports");
            Transports = (from transportName in TransportNames
                let transportConfig = TransportConfigFor(transportName)
                select new TransportSettings(transportConfig)).ToArray();
            Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));
            BackoffPeriod = config.GetTimeSpan("akka.remote.backoff-interval");
            RetryGateClosedFor = config.GetTimeSpan("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
            UsePassiveConnections = config.GetBoolean("akka.remote.use-passive-connections");
            SysMsgBufferSize = config.GetInt("akka.remote.system-message-buffer-size");
            SysResendTimeout = config.GetTimeSpan("akka.remote.resend-interval");
            SysResendLimit = config.GetInt("akka.remote.resend-limit");
            InitialSysMsgDeliveryTimeout = config.GetTimeSpan("akka.remote.initial-system-message-delivery-timeout");
            QuarantineSilentSystemTimeout = config.GetTimeSpan("akka.remote.quarantine-after-silence");
            SysMsgAckTimeout = config.GetTimeSpan("akka.remote.system-message-ack-piggyback-timeout");
            QuarantineDuration = config.GetTimeSpan("akka.remote.prune-quarantine-marker-after");

            StartupTimeout = config.GetTimeSpan("akka.remote.startup-timeout");
            CommandAckTimeout = config.GetTimeSpan("akka.remote.command-ack-timeout");

            WatchFailureDetectorConfig = config.GetConfig("akka.remote.watch-failure-detector");
            WatchFailureDetectorImplementationClass = WatchFailureDetectorConfig.GetString("implementation-class");
            WatchHeartBeatInterval = WatchFailureDetectorConfig.GetTimeSpan("heartbeat-interval");
            WatchUnreachableReaperInterval = WatchFailureDetectorConfig.GetTimeSpan("unreachable-nodes-reaper-interval");
            WatchHeartbeatExpectedResponseAfter = WatchFailureDetectorConfig.GetTimeSpan("expected-response-after");
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:50,代码来源:RemoteSettings.cs

示例5: JournalSettings

 public JournalSettings(Config config)
 {
     if (config == null) throw new ArgumentNullException("config", "Table Storage journal settings cannot be initialized, because required HOCON section couldn't be found");
     TableName = config.GetString("table-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings = new AzureStorageSettings(ConnectionStrings);
 }
开发者ID:zbynek001,项目名称:Akka.Persistence.Azure,代码行数:7,代码来源:Settings.cs

示例6: SessionSettings

        public SessionSettings(Config config)
        {
            if (config == null) throw new ArgumentNullException("config");

            Builder = Cluster.Builder();
            
            // Get IP and port configuration
            int port = config.GetInt("port", 9042);
            IPEndPoint[] contactPoints = ParseContactPoints(config.GetStringList("contact-points"), port);
            Builder.AddContactPoints(contactPoints);

            // Support user/pass authentication
            if (config.HasPath("credentials"))
                Builder.WithCredentials(config.GetString("credentials.username"), config.GetString("credentials.password"));

            // Support SSL
            if (config.GetBoolean("ssl"))
                Builder.WithSSL();

            // Support compression
            string compressionTypeConfig = config.GetString("compression");
            if (compressionTypeConfig != null)
            {
                var compressionType = (CompressionType) Enum.Parse(typeof (CompressionType), compressionTypeConfig, true);
                Builder.WithCompression(compressionType);
            }
        }
开发者ID:aachinfiev,项目名称:Akka.Persistence.Cassandra,代码行数:27,代码来源:SessionSettings.cs

示例7: FromConfig

 public static ClusterRouterGroupSettings FromConfig(Config config)
 {
     return new ClusterRouterGroupSettings(
         GetMaxTotalNrOfInstances(config),
         ImmutableHashSet.Create(config.GetStringList("routees.paths").ToArray()),
         config.GetBoolean("cluster.allow-local-routees"),
         UseRoleOption(config.GetString("cluster.use-role")));
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:8,代码来源:ClusterRoutingConfig.cs

示例8: Create

        /// <summary>
        /// Java API: Create settings from a configuration with the same layout as the default configuration 'akka.cluster.client'.
        /// </summary>
        public static ClusterClientSettings Create(Config config)
        {
            var initialContacts = config.GetStringList("initial-contacts").Select(ActorPath.Parse).ToImmutableSortedSet();

            TimeSpan? reconnectTimeout = config.GetString("reconnect-timeout").Equals("off")
                ? null
                : (TimeSpan?)config.GetTimeSpan("reconnect-timeout");

            return new ClusterClientSettings(initialContacts,
                config.GetTimeSpan("establishing-get-contacts-interval"),
                config.GetTimeSpan("refresh-contacts-interval"),
                config.GetTimeSpan("heartbeat-interval"),
                config.GetTimeSpan("acceptable-heartbeat-pause"),
                config.GetInt("buffer-size"),
                reconnectTimeout);
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:19,代码来源:ClusterClientSettings.cs

示例9: TransportSettings

 public TransportSettings(Config config)
 {
     TransportClass = config.GetString("transport-class");
     Adapters = config.GetStringList("applied-adapters").Reverse().ToList();
     Config = config;
 }
开发者ID:ClusterReply,项目名称:akka.net,代码行数:6,代码来源:RemoteSettings.cs

示例10: ScatterGatherFirstCompletedGroup

 /// <summary>
 ///     Initializes a new instance of the <see cref="ScatterGatherFirstCompletedGroup" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public ScatterGatherFirstCompletedGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
     _within = config.GetMillisDuration("within");
 }
开发者ID:ClusterReply,项目名称:akka.net,代码行数:9,代码来源:ScatterGatherFirstCompleted.cs

示例11: RandomGroup

 /// <summary>
 /// Initializes a new instance of the <see cref="RandomGroup"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public RandomGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
开发者ID:jweimann,项目名称:akka.net,代码行数:8,代码来源:Random.cs

示例12: ScatterGatherFirstCompletedGroup

 /// <summary>
 ///     Initializes a new instance of the <see cref="ScatterGatherFirstCompletedGroup" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public ScatterGatherFirstCompletedGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
     Within = config.GetTimeSpan("within");
 }
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:9,代码来源:ScatterGatherFirstCompleted.cs

示例13: RoundRobinGroup

 /// <summary>
 /// Initializes a new instance of the <see cref="RoundRobinGroup"/> class.
 /// </summary>
 /// <param name="config">
 /// The configuration to use to lookup paths used by the group router.
 /// 
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// </note>
 /// </param>
 public RoundRobinGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
开发者ID:juergenhoetzel,项目名称:akka.net,代码行数:14,代码来源:RoundRobin.cs

示例14: TailChoppingGroup

 /// <summary>
 /// Creates an instance of the TailChoppingGroup.
 /// </summary>
 /// <param name="config">The configuration to use with this instance.</param>
 public TailChoppingGroup(Config config)
 {
     Paths = config.GetStringList("routees.paths").ToArray();
     within = config.GetMillisDuration("within");
     interval = config.GetMillisDuration("tail-chopping-router.interval");
 }
开发者ID:ClusterReply,项目名称:akka.net,代码行数:10,代码来源:TailChoppingRoutingLogic.cs

示例15: ConsistentHashingGroup

 public ConsistentHashingGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:4,代码来源:ConsistentHash.cs


注:本文中的Akka.Configuration.Config.GetStringList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。