コード例 #1
0
        public void Can_serialize_RemoteScope()
        {
            var address     = new Address("akka.tcp", "TestSys", "localhost", 23423);
            var remoteScope = new RemoteScope(address);

            AssertEqual(remoteScope);
        }
コード例 #2
0
        //
        // RemoteScope
        //
        private byte[] RemoteScopeToProto(RemoteScope remoteScope)
        {
            var message = new Proto.Msg.RemoteScope();

            message.Node = AddressMessageBuilder(remoteScope.Address);
            return(message.ToByteArray());
        }
コード例 #3
0
        public void CanSerializeScope()
        {
            var message      = new RemoteScope(new Address("akka.tcp", "foo", "localhost", 8080));
            var serializer   = Sys.Serialization.FindSerializerFor(message);
            var serialized   = serializer.ToBinary(message);
            var deserialized = (RemoteScope)serializer.FromBinary(serialized, typeof(RemoteScope));

            Assert.Equal(message, deserialized);
        }
コード例 #4
0
        private void CreateRemoteCrawlerGroup()
        {
            var hostname = _systemConfiguration.RemoteHost1;

            var remoteAddress = Address.Parse($"akka.tcp://DeployTarget@{hostname}:8090");

            var remoteScope    = new RemoteScope(remoteAddress);
            var remoteCrawler2 =
                Context.ActorOf(
                    Props.Create(() => new WebCrawlerActor(new AppSettingsConfiguration(), Self))
                    .WithRouter(new RoundRobinPool(2))
                    .WithDispatcher("my-dispatcher")
                    .WithDeploy(Deploy.None.WithScope(remoteScope)), "remoteCrawler01");

            _actorDictionary.Add("WebCrawlerActor", remoteCrawler2);
        }
コード例 #5
0
        public void CanSerializeRemoteScope()
        {
            var message = new RemoteScope(new Address("akka.tcp", "foo", "localhost", 8080));

            AssertEqual(message);
        }