예제 #1
0
        private void ConvergentRemove(CRDT.Application.Convergent.Register.LWW_RegisterWithVCService <TestType> sourceReplica, TestType value, VectorClock clock, List <CRDT.Application.Convergent.Register.LWW_RegisterWithVCService <TestType> > downstreamReplicas)
        {
            sourceReplica.LocalRemove(value, clock);

            var state = sourceReplica.GetValue(value.Id);

            foreach (var downstreamReplica in downstreamReplicas)
            {
                downstreamReplica.DownstreamRemove(state.Value, state.VectorClock);
            }
        }
예제 #2
0
        private Dictionary <Node, CRDT.Application.Convergent.Register.LWW_RegisterWithVCService <TestType> > CreateConvergentReplicas(List <Node> nodes)
        {
            var dictionary = new Dictionary <Node, CRDT.Application.Convergent.Register.LWW_RegisterWithVCService <TestType> >();

            foreach (var node in nodes)
            {
                var repository = new LWW_RegisterWithVCRepository();
                var service    = new CRDT.Application.Convergent.Register.LWW_RegisterWithVCService <TestType>(repository);

                dictionary.Add(node, service);
            }

            return(dictionary);
        }