本文整理汇总了C#中RoleName类的典型用法代码示例。如果您正苦于以下问题:C# RoleName类的具体用法?C# RoleName怎么用?C# RoleName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoleName类属于命名空间,在下文中一共展示了RoleName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Role
public RoleName Role(string name)
{
if (_roles.Exists(r => r.Name == name)) throw new ArgumentException("non-unique role name " + name);
var roleName = new RoleName(name);
_roles = _roles.Add(roleName);
return roleName;
}
示例2: DeployOn
public void DeployOn(RoleName role, string deployment)
{
ImmutableList<string> roleDeployments;
_deployments.TryGetValue(role, out roleDeployments);
_deployments = _deployments.SetItem(role,
roleDeployments == null ? ImmutableList.Create(deployment) : roleDeployments.Add(deployment));
}
示例3: Join
private void Join(RoleName from, RoleName to)
{
RunOn(() =>
{
Cluster.Join(Node(to).Address);
CreateSingleton();
}, from);
}
示例4: ExcludeRole
/// <summary>
/// Excludes the role.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="roleName">Name of the role.</param>
/// <returns></returns>
public static IQueryable<User> ExcludeRole(this IQueryable<User> query, RoleName? roleName)
{
if (roleName.HasValue)
{
var exclude = new string[] { roleName.Value.ToString() };
query = query.Where(u => u.UserRoles.Select(ur => ur.Role.RoleName).Except(exclude).Any());
}
return query;
}
示例5: Join
private void Join(RoleName from, RoleName to)
{
RunOn(() =>
{
Cluster.Join(Node(to).Address);
ClusterClientReceptionist.Get(Sys);
}, from);
EnterBarrier(from.Name + "-joined");
}
示例6: RoundRobinMultiNodeConfig
public RoundRobinMultiNodeConfig()
{
First = Role("first");
Second = Role("second");
Third = Role("third");
Fourth = Role("fourth");
CommonConfig = DebugConfig(true);
DeployOnAll(@"
/service-hello {
router = round-robin-pool
nr-of-instances = 3
target.nodes = [""@[email protected]"", ""@[email protected]"", ""@[email protected]""]
}
/service-hello2 {
router = round-robin-pool
target.nodes = [""@[email protected]"", ""@[email protected]"", ""@[email protected]""]
}
/service-hello3 {
router = round-robin-group
routees.paths = [
""@[email protected]/user/target-first"",
""@[email protected]/user/target-second"",
""@[email protected]/user/target-third""]
}
");
}
示例7: ClusterClientSpecConfig
public ClusterClientSpecConfig()
{
Client = Role("client");
First = Role("first");
Second = Role("second");
Third = Role("third");
Fourth = Role("fourth");
CommonConfig = ConfigurationFactory.ParseString(@"
akka.loglevel = DEBUG
akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
akka.remote.log-remote-lifecycle-events = off
akka.cluster.auto-down-unreachable-after = 0s
akka.cluster.client.heartbeat-interval = 1s
akka.cluster.client.acceptable-heartbeat-pause = 3s
akka.cluster.client.refresh-contacts-interval = 1s
# number-of-contacts must be >= 4 because we shutdown all but one in the end
akka.cluster.client.receptionist.number-of-contacts = 4
akka.cluster.client.receptionist.heartbeat-interval = 10s
akka.cluster.client.receptionist.acceptable-heartbeat-pause = 10s
akka.cluster.client.receptionist.failure-detection-interval = 1s
akka.test.filter-leeway = 10s
")
.WithFallback(ClusterClientReceptionist.DefaultConfig())
.WithFallback(DistributedPubSub.DefaultConfig());
TestTransport = true;
}
示例8: ConsistentHashingRouterMultiNodeConfig
public ConsistentHashingRouterMultiNodeConfig()
{
_first = Role("first");
_second = Role("second");
_third = Role("third");
CommonConfig = MultiNodeLoggingConfig.LoggingConfig.WithFallback(DebugConfig(true))
.WithFallback(ConfigurationFactory.ParseString(@"
common-router-settings = {
router = consistent-hashing-pool
nr-of-instances = 10
cluster {
enabled = on
max-nr-of-instances-per-node = 2
}
}
akka.actor.deployment {
/router1 = ${common-router-settings}
/router3 = ${common-router-settings}
/router4 = ${common-router-settings}
}
akka.cluster.publish-stats-interval = 5s
"))
.WithFallback(MultiNodeClusterSpec.ClusterConfig());
}
示例9: LookupRemoteActorMultiNetSpec
public LookupRemoteActorMultiNetSpec()
{
CommonConfig = DebugConfig(false);
Master = Role("master");
Slave = Role("slave");
}
示例10: JoinWithOfflineSeedNodeConfig
public JoinWithOfflineSeedNodeConfig()
{
Seed = Role("seed");
NonSeed = Role("nonseed");
CommonConfig = DebugConfig(false).WithFallback(MultiNodeClusterSpec.ClusterConfig());
}
示例11: NodeUpConfig
public NodeUpConfig()
{
First = Role("first");
Second = Role("second");
CommonConfig = DebugConfig(false)
.WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet());
}
示例12: NodeMembershipSpecConfig
public NodeMembershipSpecConfig()
{
First = Role("first");
Second = Role("second");
Third = Role("third");
CommonConfig = MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet();
}
示例13: ClusterConsistentHashingGroupSpecConfig
public ClusterConsistentHashingGroupSpecConfig()
{
First = Role("first");
Second = Role("second");
Third = Role("third");
CommonConfig = DebugConfig(false)
.WithFallback(MultiNodeClusterSpec.ClusterConfig());
}
示例14: MembershipChangeListenerUpConfig
public MembershipChangeListenerUpConfig()
{
First = Role("first");
Second = Role("second");
Third = Role("third");
CommonConfig = DebugConfig(false)
.WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet());
}
示例15: ClientDowningNodeThatIsUnreachableMultiNodeConfig
public ClientDowningNodeThatIsUnreachableMultiNodeConfig(bool failureDetectorPuppet)
{
First = Role("first");
Second = Role("second");
Third = Role("third");
Fourth = Role("fourth");
CommonConfig= DebugConfig(false).WithFallback(MultiNodeClusterSpec.ClusterConfig(failureDetectorPuppet));
}