示例#1
0
        private void CommutativeAdd(CRDT.Application.Commutative.Counter.G_CounterService sourceReplica, Guid replicaId, int value, List <CRDT.Application.Commutative.Counter.G_CounterService> downstreamReplicas)
        {
            sourceReplica.DownstreamAdd(value, replicaId);

            foreach (var downstreamReplica in downstreamReplicas)
            {
                downstreamReplica.DownstreamAdd(value, replicaId);
            }
        }
示例#2
0
        private Dictionary <Node, CRDT.Application.Commutative.Counter.G_CounterService> CreateCommutativeReplicas(List <Node> nodes)
        {
            var dictionary = new Dictionary <Node, CRDT.Application.Commutative.Counter.G_CounterService>();

            foreach (var node in nodes)
            {
                var repository = new G_CounterRepository();
                var service    = new CRDT.Application.Commutative.Counter.G_CounterService(repository);

                dictionary.Add(node, service);
            }

            return(dictionary);
        }