Ejemplo n.º 1
0
        private void ConvergentRemove(CRDT.Application.Convergent.Set.LWW_OptimizedSetService <TestType> sourceReplica, TestType value, long timestamp, List <CRDT.Application.Convergent.Set.LWW_OptimizedSetService <TestType> > downstreamReplicas)
        {
            sourceReplica.LocalRemove(value, timestamp);

            foreach (var downstreamReplica in downstreamReplicas)
            {
                downstreamReplica.Merge(sourceReplica.State);
            }
        }
Ejemplo n.º 2
0
        private Dictionary <Node, CRDT.Application.Convergent.Set.LWW_OptimizedSetService <TestType> > CreateConvergentReplicas(List <Node> nodes)
        {
            var dictionary = new Dictionary <Node, CRDT.Application.Convergent.Set.LWW_OptimizedSetService <TestType> >();

            foreach (var node in nodes)
            {
                var repository = new LWW_OptimizedSetRepository();
                var service    = new CRDT.Application.Convergent.Set.LWW_OptimizedSetService <TestType>(repository);

                dictionary.Add(node, service);
            }

            return(dictionary);
        }