Exemplo n.º 1
0
        public async Task TestLoadBalancer()
        {
            var store = new OdinMemoryStore();
            var counter1 = new Counter(store);
            var counter2 = new Counter(store);

            var loadBalancer = new LoadBalancer(LoadBalancer.Strategy.RoundRobin, counter1, counter2);
            await OdinTests.BasicOperations(loadBalancer);

            Assert.AreNotSame(0, counter1.PutCount);
            Assert.AreNotSame(0, counter2.PutCount);

        }
Exemplo n.º 2
0
 public LoadBalancer(LoadBalancer.Strategy strategy, params IOdin[] stores)
 {
     this.CurrentStrategy = strategy;
     this.Stores = stores;
 }