Пример #1
0
        public void TestServiceFarmLoadBalancerReleaseClientProxyMessageBus()
        {
            IServiceFarmLoadBalancer serviceFarmLoadBalancer = _erector.Container.Resolve <IServiceFarmLoadBalancer>();
            IClientProxy             clientProxy             = _erector.Container.Resolve <IClientProxy>();

            bool success = serviceFarmLoadBalancer.RegisterClientProxyMessageBus(clientProxy);

            Assert.IsTrue(success);
            success = false;

            success = serviceFarmLoadBalancer.ReleaseClientProxyMessageBus(clientProxy);
            Assert.IsTrue(success);
        }
Пример #2
0
        public string ProcessRequestInServiceFarm(string json, IServiceFarmLoadBalancer serviceFarmLoadBalancer, IClientProxy clientProxy)
        {
            serviceFarmLoadBalancer.RegisterClientProxyMessageBus(clientProxy);
            string response = String.Empty;
            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();

            if (serviceFarmLoadBalancer.SendServiceRequest(clientProxy.ServiceGUID, json))
            {
                response = clientProxy.PollMessageBus(cancellationTokenSource);
            }

            serviceFarmLoadBalancer.ReleaseClientProxyMessageBus(clientProxy);
            return(response);
        }