示例#1
0
            protected override InternalActorRef CreateUserGuardian(GuardianActorRef rootGuardian)
            {
                var localActorRef = A.Fake <LocalActorRef>(builder => builder.WithArgumentsForConstructor(() => new LocalActorRef(this, A.Fake <ActorInstantiator>(), new RootActorPath("test"), CreateDefaultMailbox(), A.Fake <InternalActorRef>())));

                A.CallTo(() => localActorRef.CreateActor(A <ActorCreationProperties> .Ignored, A <string> .Ignored)).Invokes(a => Children.Add((string)a.Arguments[1]));
                return(localActorRef);
            }
示例#2
0
        private GuardianActorRef CreateRootGuardian()
        {
            var supervisor   = new RootGuardianSupervisor(_rootPath, this);
            var rootGuardian = new GuardianActorRef(this, ActorCreationProperties.Create(() => new Guardian()), _rootPath, CreateDefaultMailbox(), supervisor);

            return(rootGuardian);
        }
示例#3
0
 public void Start()
 {
     _isStarted      = true;
     _rootGuardian   = CreateRootGuardian();
     _systemGuardian = CreateSystemGuardian(_rootGuardian);
     _userGuardian   = CreateUserGuardian(_rootGuardian);
     _rootGuardian.Start();
     // chain death watchers so that killing guardian stops the application
     _systemGuardian.SendSystemMessage(new WatchActor(_userGuardian, _systemGuardian), null);
     _rootGuardian.SendSystemMessage(new WatchActor(_systemGuardian, _rootGuardian), null);
     _eventStream.StartDefaultLoggers();
     _eventStream.LogInfo(_logSource, this, "System started");
 }
示例#4
0
        protected virtual InternalActorRef CreateUserGuardian(GuardianActorRef rootGuardian)
        {
            var userGuardian = rootGuardian.CreateGuardian(() => new Guardian(), "user");

            return(userGuardian);
        }
示例#5
0
        private InternalActorRef CreateSystemGuardian(GuardianActorRef rootGuardian)
        {
            var systemGuardian = rootGuardian.CreateGuardian(() => new Guardian(), "system");

            return(systemGuardian);
        }