示例#1
0
        public OrSet <T> Updated(OrSet <T> crdt, object operation, DurableEvent e)
        {
            if (operation is RemoveOp <T> )
            {
                var remove = (RemoveOp <T>)operation;
                return(crdt.Remove(remove.Entry, remove.Timestamps));
            }

            if (operation is AddOp <T> )
            {
                var add = (AddOp <T>)operation;
                return(crdt.Add(add.Entry, e.VectorTimestamp));
            }

            return(crdt);
        }
示例#2
0
        public object Updating(OrSet <T> crdt, object operation)
        {
            if (operation is RemoveOp <T> )
            {
                var op         = (RemoveOp <T>)operation;
                var timestamps = crdt.PrepareRemove(op.Entry);

                if (timestamps.Count != 0)
                {
                    return(new RemoveOp <T>(op.Entry, timestamps));
                }

                return(null);
            }

            return(operation);
        }
示例#3
0
 public IImmutableSet <T> GetValue(OrSet <T> crdt)
 {
     return(crdt.Value.ToImmutableHashSet());
 }