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); } }
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); }