Beispiel #1
0
        private static ActorSystem CreateAndStartSystem(string name, Config withFallback)
        {
            var system = new ActorSystemImpl(name, withFallback);

            system.Start();
            return(system);
        }
Beispiel #2
0
        private static ActorSystem CreateAndStartSystem(string name, Config withFallback, ActorSystemSetup setup)
        {
            var system = new ActorSystemImpl(name, withFallback, setup, Option <Props> .None);

            system.Start();
            return(system);
        }
Beispiel #3
0
        public void Does_not_log_config_on_start()
        {
            var config = ConfigurationFactory.ParseString("akka.log-config-on-start = off")
                         .WithFallback(DefaultConfig);

            var system = new ActorSystemImpl(Guid.NewGuid().ToString(), config);

            // Actor system should be started to attach the EventFilterFactory
            system.Start();

            var eventFilter = new EventFilterFactory(new TestKit.Xunit2.TestKit(system));

            // Notice here we forcedly start actor system again to monitor how it processes
            eventFilter.Info().Expect(0, () => system.Start());

            system.Terminate();
        }
Beispiel #4
0
        public void Logs_config_on_start_with_info_level()
        {
            var config = ConfigurationFactory.ParseString("akka.log-config-on-start = on")
                         .WithFallback(DefaultConfig);

            var system = new ActorSystemImpl(Guid.NewGuid().ToString(), config, ActorSystemSetup.Empty);

            // Actor system should be started to attach the EventFilterFactory
            system.Start();

            var eventFilter = new EventFilterFactory(new TestKit.Xunit2.TestKit(system));

            // Notice here we forcedly start actor system again to monitor how it processes
            var expected = "log-config-on-start : on";

            eventFilter.Info(contains: expected).ExpectOne(() => system.Start());

            system.Terminate();
        }
Beispiel #5
0
        private static ActorSystem CreateAndStartSystem(string name, Config withFallback, ActorSystemSetup setup)
        {
            // allows the ThreadPool to scale up / down dynamically
            // by removing minimum thread count, which in our benchmarks
            // appears to negatively impact performance
            ThreadPool.SetMinThreads(0, 0);
            var system = new ActorSystemImpl(name, withFallback, setup, Option <Props> .None);

            system.Start();
            return(system);
        }
Beispiel #6
0
        public void ActorOf_gives_child_unique_name_if_not_specified()
        {
            //arrange
            var system = new ActorSystemImpl("test");
            system.Start(); //When we create a system manually we have to start it ourselves
            //act
            var child1 = system.ActorOf<TestActor>();
            var child2 = system.ActorOf<TestActor>();

            //assert
            Assert.NotEqual(child1.Path, child2.Path);
        }
Beispiel #7
0
        public void ActorSystem_ActorOf_adds_a_child_to_Guardian()
        {
            //arrange
            var system = new ActorSystemImpl("test");
            system.Start(); //When we create a system manually we have to start it ourselves

            //act
            var child = system.ActorOf<TestActor>("test");

            //assert
            var children = system.Provider.Guardian.Children;
            Assert.True(children.Any(c => c == child));
        }        
Beispiel #8
0
        public void ActorOf_gives_child_unique_name_if_not_specified()
        {
            //arrange
            var system = new ActorSystemImpl("test");

            system.Start(); //When we create a system manually we have to start it ourselves
            //act
            var child1 = system.ActorOf <TestActor>();
            var child2 = system.ActorOf <TestActor>();

            //assert
            Assert.NotEqual(child1.Path, child2.Path);
        }
Beispiel #9
0
        public void ActorSystem_ActorOf_adds_a_child_to_Guardian()
        {
            //arrange
            var system = new ActorSystemImpl("test");

            system.Start(); //When we create a system manually we have to start it ourselves

            //act
            var child = system.ActorOf <TestActor>("test");

            //assert
            var children = system.Provider.Guardian.Children;

            Assert.True(children.Any(c => c == child));
        }