コード例 #1
0
ファイル: ActorPaths.cs プロジェクト: Sven1106/Portia
        public static ActorSelection ActorSelection(this IUntypedActorContext context, ActorMetaData targetActorMetaData)
        {
            var pathWithOutAdress = context.Self.Path.ToString().Replace(context.Self.Path.Address.ToString(), "");
            var source            = pathWithOutAdress.TrimStart('/').Split('/').ToList();

            source.Reverse();

            var target = new List <string>();
            var currentActorMetaData = targetActorMetaData;

            while (currentActorMetaData != null)
            {
                if (currentActorMetaData.Name != null)
                {
                    target.Add(currentActorMetaData.Name);
                }
                else
                {
                    target.Add(null);
                }
                currentActorMetaData = currentActorMetaData.Parent;
            }
            target.Add("user");
            string relativePath = CreateInterpretedRelativePath(source, target);

            return(context.ActorSelection(relativePath));
        }
コード例 #2
0
 public static ActorSelection ActorSelection(this IUntypedActorContext context, ActorMetadata actor, ActorPathType path = ActorPathType.Absolute)
 {
     return(context.ActorSelection(actor.Path));
     //switch (path)
     //{
     //    case ActorPathType.Absolute:
     //        return context.ActorSelection(actor.Path);
     //    case ActorPathType.Relative:
     //        return context.ActorSelection(actor.RelativeUri);
     //    default:
     //        return context.ActorSelection(actor.AbsoluteUri);
     //}
 }
コード例 #3
0
 public static void Evalutate(this IUntypedActorContext context)
 {
     context.ActorSelection("/user/orch").Tell(new Evalutate());
 }
コード例 #4
0
 public static void TellOrc(this IUntypedActorContext context, object msg)
 {
     context.ActorSelection("/user/orch").Tell(msg);
 }
コード例 #5
0
 public static ActorSelection SelectTestServiceActor(this IUntypedActorContext context, string serviceEndpoint)
 {
     return(context.ActorSelection($"akka.tcp://TestServiceSystem@{serviceEndpoint}/user/TestService"));
 }