• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ActorPath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ActorPath的典型用法代码示例。如果您正苦于以下问题:C# ActorPath类的具体用法?C# ActorPath怎么用?C# ActorPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActorPath类属于命名空间,在下文中一共展示了ActorPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RoutedActorCell

        public RoutedActorCell(ActorSystem system, InternalActorRef supervisor, Props routerProps, Props routeeProps, ActorPath path,
            Mailbox mailbox)
            : base(system, supervisor, routerProps, path, mailbox)
        {
            RouteeProps = routeeProps;
            routerConfig = routerProps.RouterConfig;
            Router = routerConfig.CreateRouter(system);
            routerConfig.Match()
                .With<Pool>(r =>
                {
                    var routees = new List<Routee>();
                    for (int i = 0; i < r.NrOfInstances; i++)
                    {
                        var routee = this.ActorOf(RouteeProps);
                        routees.Add(new ActorRefRoutee(routee));
                    }
                    AddRoutees(routees.ToArray());
                })
                .With<Group>(r =>
                {
                    var routees = routerConfig.GetRoutees(this).ToArray();
                    AddRoutees(routees);
                });



            Self = new RoutedActorRef(path, this);
        }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:28,代码来源:RoutedActorCell.cs


示例2: Delivery

 public Delivery(ActorPath destination, object message, DateTime timestamp, int attempt)
 {
     Destination = destination;
     Message = message;
     Timestamp = timestamp;
     Attempt = attempt;
 }
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:7,代码来源:GuaranteedDelivery.cs


示例3: CreateFromStringAndToString

        public void CreateFromStringAndToString()
        {
            string path ="abc\\def";
            var ap = new ActorPath(path);

            Assert.AreEqual(path, ap.ToString());
        }
开发者ID:lebaon,项目名称:AEF,代码行数:7,代码来源:ActorPathTests.cs


示例4: FutureActorRef

 public FutureActorRef(TaskCompletionSource<object> result, ActorRef sender, Action unregister, ActorPath path)
 {
     _result = result;
     _sender = sender ?? ActorRef.NoSender;
     _unregister = unregister;
     Path = path;
 }
开发者ID:pdoh00,项目名称:akka.net,代码行数:7,代码来源:ActorRef.cs


示例5: RootGuardianSupervisor

 public RootGuardianSupervisor(RootActorPath root, IActorRefProvider provider, TaskCompletionSource<Status> terminationPromise, ILoggingAdapter log)
 {
     _log = log;
     _terminationPromise = terminationPromise;
     _provider = provider;
     _path = root / "_Root-guardian-supervisor";   //In akka this is root / "bubble-walker" 
 }
开发者ID:yaozd,项目名称:akka.net,代码行数:7,代码来源:RootGuardianSupervisor.cs


示例6: RootGuardianActorRef

 public RootGuardianActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, //TODO: switch from  Func<Mailbox> createMailbox to MailboxType mailboxType
     IInternalActorRef supervisor, ActorPath path, IInternalActorRef deadLetters, IReadOnlyDictionary<string, IInternalActorRef> extraNames)
     : base(system,props,dispatcher,createMailbox,supervisor,path)
 {
     _deadLetters = deadLetters;
     _extraNames = extraNames;
 }
开发者ID:yaozd,项目名称:akka.net,代码行数:7,代码来源:RootGuardianActorRef.cs


示例7: FutureActorRef

 public FutureActorRef(TaskCompletionSource<object> result, ActorRef sender, Action unregister, ActorPath path)
 {
     this.result = result;
     this.sender = sender;
     this.unregister = unregister;
     Path = path;
 }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:7,代码来源:ActorRef.cs


示例8: CreateFromParentAndToString

        public void CreateFromParentAndToString()
        {
            var ap1 = new ActorPath("");
            var ap2 = new ActorPath("test", ap1);

            Assert.AreEqual("\\test", ap2.ToString());
        }
开发者ID:lebaon,项目名称:AEF,代码行数:7,代码来源:ActorPathTests.cs


示例9: Convert

            public static SurrogateForActorPath Convert(ActorPath value)
            {
                if (value == null)
                    return null;

                var path = ((ActorPath.Surrogate)value.ToSurrogate(CurrentSystem)).Path;
                return new SurrogateForActorPath { Path = path };
            }
开发者ID:SaladLab,项目名称:Akka.Interfaced,代码行数:8,代码来源:AkkaSurrogate.cs


示例10: WhenAddChild_ThenNewActorRefPathIncludesCurrentPlusChild

 public void WhenAddChild_ThenNewActorRefPathIncludesCurrentPlusChild()
 {
     var actorPath = new ActorPath("root", null);
     ActorPath childPath = actorPath.AddChild("child");
     string[] elements = childPath.Elements.ToArray();
     Assert.AreEqual("root", elements[0]);
     Assert.AreEqual("child", elements[1]);
 }
开发者ID:subfuzion,项目名称:ax,代码行数:8,代码来源:ActorPathTest.cs


示例11: Setup

 public void Setup(BenchmarkContext context)
 {
     _selectionOpCounter = context.GetCounter(ActorSelectionCounterName);
     System = ActorSystem.Create("MailboxThroughputSpecBase" + Counter.GetAndIncrement());
     _receiver = System.ActorOf(Props.Create(() => new BenchmarkActor(_selectionOpCounter, NumberOfMessages, _resetEvent)));
     _receiverActorPath = _receiver.Path;
     _oneMessageBenchmarkProps = Props.Create(() => new BenchmarkActor(_selectionOpCounter, 1, _resetEvent));
 }
开发者ID:juergenhoetzel,项目名称:akka.net,代码行数:8,代码来源:ActorSelectionSpecs.cs


示例12: Lookup

        public Deploy Lookup(ActorPath path)
        {
            if (path.Elements.Head() != "user" || path.Elements.Count() < 2)
                return Deploy.None;

            var elements = path.Elements.Drop(1);
            return Lookup(elements);
        }
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:8,代码来源:Deployer.cs


示例13: EqualsTest

        public void EqualsTest()
        {
            var ap1 = new ActorPath("");
            var ap2 = new ActorPath("test", ap1);
            var ap3 = new ActorPath("\\test");

            Assert.IsTrue(ap2 == ap3);
            Assert.IsFalse(ap1 == ap3);
        }
开发者ID:lebaon,项目名称:AEF,代码行数:9,代码来源:ActorPathTests.cs


示例14: RepointableActorRef

 public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, MailboxType mailboxType, IInternalActorRef supervisor, ActorPath path)
 {
     System = system;
     Props = props;
     Dispatcher = dispatcher;
     MailboxType = mailboxType;
     Supervisor = supervisor;
     _path = path;
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:9,代码来源:RepointableActorRef.cs


示例15: Activate

        async Task Activate(ActorPath path)
        {
            var system = ClusterActorSystem.Current;

            actor = Activator.Activate(path.Type);
            actor.Initialize(path.Id, system, this, ActorPrototype.Of(path.Type));

            await actor.OnActivate();
        }
开发者ID:amartynenko,项目名称:Orleankka,代码行数:9,代码来源:ActorEndpoint.cs


示例16: RepointableActorRef

 public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path)
 {
     _system = system;
     _props = props;
     _dispatcher = dispatcher;
     _createMailbox = createMailbox;
     _supervisor = supervisor;
     _path = path;
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:9,代码来源:RepointableActorRef.cs


示例17: WhenAddDescendant_ThenNewActorRefPathIncludesCurrentPlusAllDescendants

 public void WhenAddDescendant_ThenNewActorRefPathIncludesCurrentPlusAllDescendants()
 {
     var actorPath = new ActorPath("root", null);
     ActorPath childPath1 = actorPath.AddChild("child1");
     ActorPath childPath2 = childPath1.AddChild("child2");
     string[] elements = childPath2.Elements.ToArray();
     Assert.AreEqual("root", elements[0]);
     Assert.AreEqual("child1", elements[1]);
     Assert.AreEqual("child2", elements[2]);
 }
开发者ID:subfuzion,项目名称:ax,代码行数:10,代码来源:ActorPathTest.cs


示例18: WhenAddDescendantsWithPathString_ThenNewActorRefPathIncludesCurrentPlusChild

 public void WhenAddDescendantsWithPathString_ThenNewActorRefPathIncludesCurrentPlusChild()
 {
     var actorPath = new ActorPath("root", null);
     ActorPath childPath = actorPath.AddDescendant("child1/child2/child3");
     string[] elements = childPath.Elements.ToArray();
     Assert.AreEqual("root", elements[0]);
     Assert.AreEqual("child1", elements[1]);
     Assert.AreEqual("child2", elements[2]);
     Assert.AreEqual(actorPath, childPath.Root);
 }
开发者ID:subfuzion,项目名称:ax,代码行数:10,代码来源:ActorPathTest.cs


示例19: Proxy

        public static IActorEndpoint Proxy(ActorPath path)
        {
            var factory = factories.Find(path.Type);

            if (factory == null)
               throw new InvalidOperationException(
                   string.Format("Type: '{0}' is not registered as an Actor or Worker", path.Type));

            return (IActorEndpoint)factory(path.ToString());
        }
开发者ID:supwar,项目名称:Orleankka,代码行数:10,代码来源:ActorEndpointFactory.cs


示例20: LocalActorRef

 /// <summary>
 /// Inheritors should only call this constructor
 /// </summary>
 internal protected  LocalActorRef(ActorSystem system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path, Func<LocalActorRef, ActorCell> createActorCell) //TODO: switch from  Func<Mailbox> createMailbox to MailboxType mailboxType      
 {
     _system = system;
     _props = props;
     _dispatcher = dispatcher;
     _createMailbox = createMailbox;
     _supervisor = supervisor;
     _path = path;
     _cell = createActorCell(this);
 }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:13,代码来源:LocalActorRef.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ActorSystem类代码示例发布时间:2022-05-24
下一篇:
C# ActorMaterializer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap