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


C# RoleName类代码示例

本文整理汇总了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;
 }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:7,代码来源:MultiNodeSpec.cs

示例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));
 }
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:7,代码来源:MultiNodeSpec.cs

示例3: Join

 private void Join(RoleName from, RoleName to)
 {
     RunOn(() =>
     {
         Cluster.Join(Node(to).Address);
         CreateSingleton();
     }, from);
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:8,代码来源:ClusterSingletonManagerLeaveSpec.cs

示例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;
 }
开发者ID:rickeygalloway,项目名称:Test,代码行数:15,代码来源:UserQueryExtensions.cs

示例5: Join

 private void Join(RoleName from, RoleName to)
 {
     RunOn(() =>
     {
         Cluster.Join(Node(to).Address);
         ClusterClientReceptionist.Get(Sys);
     }, from);
     EnterBarrier(from.Name + "-joined");
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:9,代码来源:ClusterClientStopSpec.cs

示例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""]
      }
           ");
        }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:28,代码来源:RemoteRoundRobinSpec.cs

示例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;
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:28,代码来源:ClusterClientSpec.cs

示例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());
        }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:25,代码来源:ClusterConsistentHashingRouterSpec.cs

示例9: LookupRemoteActorMultiNetSpec

        public LookupRemoteActorMultiNetSpec()
        {
            CommonConfig = DebugConfig(false);

            Master = Role("master");
            Slave = Role("slave");
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:7,代码来源:LookupRemoteActorMultiNetSpec.cs

示例10: JoinWithOfflineSeedNodeConfig

        public JoinWithOfflineSeedNodeConfig()
        {
            Seed = Role("seed");
            NonSeed = Role("nonseed");

            CommonConfig = DebugConfig(false).WithFallback(MultiNodeClusterSpec.ClusterConfig());
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:7,代码来源:JoinWithOfflineSeedNodeSpec.cs

示例11: NodeUpConfig

        public NodeUpConfig()
        {
            First = Role("first");
            Second = Role("second");

            CommonConfig = DebugConfig(false)
                .WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet());
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:8,代码来源:NodeUpSpec.cs

示例12: NodeMembershipSpecConfig

        public NodeMembershipSpecConfig()
        {
            First = Role("first");
            Second = Role("second");
            Third = Role("third");

            CommonConfig = MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet();
        }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:8,代码来源:NodeMembershipSpec.cs

示例13: ClusterConsistentHashingGroupSpecConfig

        public ClusterConsistentHashingGroupSpecConfig()
        {
            First = Role("first");
            Second = Role("second");
            Third = Role("third");

            CommonConfig = DebugConfig(false)
                .WithFallback(MultiNodeClusterSpec.ClusterConfig());
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:9,代码来源:ClusterConsistentHashingGroupSpec.cs

示例14: MembershipChangeListenerUpConfig

        public MembershipChangeListenerUpConfig()
        {
            First = Role("first");
            Second = Role("second");
            Third = Role("third");

            CommonConfig = DebugConfig(false)
                .WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet());
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:9,代码来源:MembershipChangeListenerUpSpec.cs

示例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));
        }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:9,代码来源:ClientDowningNodeThatIsUnreachableSpec.cs


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