Ejemplo n.º 1
0
        /// <summary>
        ///     Resolves the actor reference.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns>ActorRef.</returns>
        public ActorRef ResolveActorRef(string path)
        {
            if (path == "")
            {
                return(ActorRef.NoSender);
            }

            ActorPath actorPath = ActorPath.Parse(path);

            return(ResolveActorRef(actorPath));
        }
Ejemplo n.º 2
0
        public ActorSelection ActorSelection(string path)
        {
            if (Uri.IsWellFormedUriString(path, UriKind.Absolute))
            {
                ActorPath actorPath = ActorPath.Parse(path);
                ActorRef  actorRef  = System.Provider.RootGuardianAt(actorPath.Address);
                return(new ActorSelection(actorRef, actorPath.Elements.ToArray()));
            }
            //no path given
            if (string.IsNullOrEmpty(path))
            {
                return(new ActorSelection(System.DeadLetters, ""));
            }

            //absolute path
            if (path.Split('/').First() == "")
            {
                return(new ActorSelection(System.Provider.RootCell.Self, path.TrimStart('/')));
            }

            return(new ActorSelection(Self, path));
        }