Exemplo n.º 1
0
        protected override Tuple <IActorCreator, ActorSystem> GetActorCreator(LocalActorRefFactory localActorRefFactory, IBootstrapper bootstrapper = null)
        {
            if (bootstrapper == null)
            {
                var testBootstrapper = new TestBootstrapper();
                if (localActorRefFactory != null)
                {
                    testBootstrapper.LocalActorRefFactory = localActorRefFactory;
                }
                bootstrapper = testBootstrapper;
            }
            var system = new InternalActorSystem("default", bootstrapper);

            system.Start();
            return(new Tuple <IActorCreator, ActorSystem>(system, system));
        }
Exemplo n.º 2
0
        protected override Tuple <IActorCreator, ActorSystem> GetActorCreator(LocalActorRefFactory localActorRefFactory, IBootstrapper bootstrapper = null)
        {
            if (bootstrapper == null)
            {
                var testBootstrapper = new TestBootstrapper();
                if (localActorRefFactory != null)
                {
                    testBootstrapper.LocalActorRefFactory = localActorRefFactory;
                }
                bootstrapper = testBootstrapper;
            }

            var system = new InternalActorSystem("default", bootstrapper);

            system.Start();
            Actor actor = null;

            system.CreateActor(ActorCreationProperties.Create(() =>
            {
                actor = new ParentActor();
                return(actor);
            }), "Parent");
            return(new Tuple <IActorCreator, ActorSystem>(actor, system));
        }