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


C# ActorPath类代码示例

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


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


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