Beispiel #1
0
        public void Add(MessageEnvelope envelope)
        {
            var id = GetId(envelope);
            ConsensusAggregate aggregate = GetConsensusAggregate(id);

            //add the signature to the aggregate
            aggregate.Add(envelope);
        }
Beispiel #2
0
        public void Add(IncomingMessage message)
        {
            var id = GetId(message.Envelope);
            ConsensusAggregate aggregate = GetConsensusAggregate(id);

            //add the signature to the aggregate
            aggregate.Add(message);
        }
Beispiel #3
0
 private ConsensusAggregate GetConsensusAggregate(string id)
 {
     lock (syncRoot)
     {
         if (!pendingAggregates.TryGetValue(id, out var consensusAggregate))
         {
             consensusAggregate    = new ConsensusAggregate(id, this);
             pendingAggregates[id] = consensusAggregate;
         }
         return(consensusAggregate);
     }
 }