Akka.Cluster.Tools.Tests.MultiNode.PublishSubscribe.DistributedPubSubMediatorSpec.DistributedPubSubMediator_should_demonstrate_usage C# (CSharp) Method

DistributedPubSubMediator_should_demonstrate_usage() public method

        public void DistributedPubSubMediator_should_demonstrate_usage()
        {
            DistributedPubSubMediator_should_publish_to_topic();

            Within(TimeSpan.FromSeconds(15), () =>
            {
                RunOn(() =>
                {
                    Sys.ActorOf(Props.Create<Subscriber>(), "subscriber1");
                }, _first);

                RunOn(() =>
                {
                    Sys.ActorOf(Props.Create<Subscriber>(), "subscriber2");
                    Sys.ActorOf(Props.Create<Subscriber>(), "subscriber3");
                }, _second);

                RunOn(() =>
                {
                    var publisher = Sys.ActorOf(Props.Create<Publisher>(), "publisher");
                    AwaitCount(10);
                    // after a while the subscriptions are replicated
                    publisher.Tell("hello");
                }, _third);
                EnterBarrier("after-8");
            });
        }