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


C# ImmutableList.Head方法代码示例

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


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

示例1: ParserError

 public ParserError(string expected, ImmutableList<ParserChar> input, string message = "")
 {
     Message = message;
     Expected = expected;
     Input = input;
     if (input.IsEmpty)
     {
         Location = SrcLoc.EndOfSource;
     }
     else
     {
         Location = input.Head().Location;
     }
 }
开发者ID:ApocalypticOctopus,项目名称:csharp-monad,代码行数:14,代码来源:ParserError.cs

示例2: FirstSeedNodeProcess

        public FirstSeedNodeProcess(ImmutableList<Address> seeds)
        {
            _cluster = Cluster.Get(Context.System);
            _selfAddress = _cluster.SelfAddress;

            if (seeds.Count <= 1 || seeds.Head() != _selfAddress)
                throw new ArgumentException("Join seed node should not be done");

            _remainingSeeds = seeds.Remove(_selfAddress);
            _timeout = Deadline.Now + _cluster.Settings.SeedNodeTimeout;
            _retryTaskToken = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), Self, new InternalClusterAction.JoinSeenNode(), Self);
            Self.Tell(new InternalClusterAction.JoinSeenNode());
        }
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:13,代码来源:ClusterDaemon.cs

示例3: JoinSeedNodes

 public void JoinSeedNodes(ImmutableList<Address> seedNodes)
 {
     if (seedNodes.Any())
     {
         StopSeedNodeProcess();
         if (seedNodes.SequenceEqual(ImmutableList.Create(_cluster.SelfAddress)))
         {
             Self.Tell(new ClusterUserAction.JoinTo(_cluster.SelfAddress));
             _seedNodeProcess = null;
         }
         else
         {
             // use unique name of this actor, stopSeedNodeProcess doesn't wait for termination
             _seedNodeProcessCounter += 1;
             if (seedNodes.Head().Equals(_cluster.SelfAddress))
             {
                 _seedNodeProcess = Context.ActorOf(Props.Create(() => new FirstSeedNodeProcess(seedNodes)), "firstSeedNodeProcess-" + _seedNodeProcessCounter);
             }
             else
             {
                 _seedNodeProcess = Context.ActorOf(Props.Create(() => new JoinSeedNodeProcess(seedNodes)).WithDispatcher(_cluster.Settings.UseDispatcher), "joinSeedNodeProcess-" + _seedNodeProcessCounter);
             }
         }
     }
 }
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:25,代码来源:ClusterDaemon.cs

示例4: JoinSeedNodeProcess

 public JoinSeedNodeProcess(ImmutableList<Address> seeds)
 {
     _selfAddress = Cluster.Get(Context.System).SelfAddress;
     _seeds = seeds;
     if (!seeds.Any() || seeds.Head() == _selfAddress)
         throw new ArgumentException("Join seed node should not be done");
     Context.SetReceiveTimeout(Cluster.Get(Context.System).Settings.SeedNodeTimeout);
 }
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:8,代码来源:ClusterDaemon.cs


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