本文整理汇总了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);
}
示例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");
}
示例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();
}
示例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");
}
示例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);
}
示例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);
}
}
示例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")));
}
示例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);
}
示例9: TransportSettings
public TransportSettings(Config config)
{
TransportClass = config.GetString("transport-class");
Adapters = config.GetStringList("applied-adapters").Reverse().ToList();
Config = config;
}
示例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");
}
示例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"))
{
}
示例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");
}
示例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"))
{
}
示例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");
}
示例15: ConsistentHashingGroup
public ConsistentHashingGroup(Config config)
: base(config.GetStringList("routees.paths"))
{
}