Beispiel #1
0
 public PureCrdtActor(string serviceId, string crdtId, IActorRef eventLog, StabilitySettings stabilitySettings = null)
 {
     Id                     = serviceId + "_" + crdtId;
     AggregateId            = typeof(TCrdt).Name + "_" + crdt;
     EventLog               = eventLog;
     this.stabilitySettings = stabilitySettings;
     this.crdtId            = crdtId;
     this.crdt              = default(TOperations).Zero;
     this.rtm               = !(stabilitySettings is null) ? new Rtm(stabilitySettings) : default;
        public Rtm(StabilitySettings settings)
        {
            this.localPartition = settings.LocalPartition;

            var builder = ImmutableDictionary.CreateBuilder <string, VectorTime>();

            foreach (var partition in settings.Partitions)
            {
                if (partition != this.localPartition)
                {
                    builder[partition] = VectorTime.Zero;
                }
            }
            this.timestamps = builder.ToImmutable();
        }