Akka.Actor.RootGuardianActorRef.GetSingleChild C# (CSharp) Method

GetSingleChild() public method

public GetSingleChild ( string name ) : IInternalActorRef
name string
return IInternalActorRef
        public override IInternalActorRef GetSingleChild(string name)
        {
            switch(name)
            {
                case "temp":
                    return _tempContainer;
                case "deadLetters":
                    return _deadLetters;
                default:
                    IInternalActorRef extraActorRef;
                    if(_extraNames.TryGetValue(name, out extraActorRef))
                        return extraActorRef;
                    return base.GetSingleChild(name);
            }
        }
    }

Usage Example

 public void Getting_an_unknown_child_that_exists_in_extraNames_Should_return_nobody()
 {
     var props = Props.Create<GuardianActor>(new OneForOneStrategy(e => Directive.Stop));
     var rootGuardianActorRef = new RootGuardianActorRef(sys, props, _dispatcher, () => sys.Mailboxes.FromConfig(""), ActorRef.Nobody, _rootActorPath, _deadLetters, _emptyExtraNames);
     var actorRef = rootGuardianActorRef.GetSingleChild("unknown-child");
     Assert.Same(ActorRef.Nobody, actorRef);
 }
All Usage Examples Of Akka.Actor.RootGuardianActorRef::GetSingleChild