private ActorRef ResolveActorRef(InternalActorRef actorRef, IReadOnlyCollection <string> pathElements) { if (pathElements.Count == 0) { _log.Debug("Resolve of empty path sequence fails (per definition)"); return(_deadLetters); } var child = actorRef.GetChild(pathElements); if (child.IsNobody()) { _log.Debug("Resolve of path sequence [/{0}] failed", ActorPath.FormatPathElements(pathElements)); return(new EmptyLocalActorRef(_system.Provider, actorRef.Path / pathElements, _eventStream)); } return(child); }
/* * override def getChild(name: Iterator[String]): InternalActorRef = { * if (name.isEmpty) this * else { * val n = name.next() * if (n.isEmpty) this * else children.get(n) match { * case null ⇒ Nobody * case some ⇒ * if (name.isEmpty) some * else some.getChild(name) * } * } * } */ public override ActorRef GetChild(IEnumerable <string> name) { //TODO: I have no clue what the scala version does if (!name.Any()) { return(this); } string n = name.First(); if (string.IsNullOrEmpty(n)) { return(this); } InternalActorRef c = children[n]; if (c == null) { return(Nobody); } return(c.GetChild(name.Skip(1))); }
private ActorRef ResolveActorRef(InternalActorRef actorRef, IReadOnlyCollection<string> pathElements) { if(pathElements.Count == 0) { _log.Debug("Resolve of empty path sequence fails (per definition)"); return _deadLetters; } var child = actorRef.GetChild(pathElements); if(child.IsNobody()) { _log.Debug("Resolve of path sequence [/{0}] failed", ActorPath.FormatPathElements(pathElements)); return new EmptyLocalActorRef(_system.Provider, actorRef.Path / pathElements, _eventStream); } return child; }