Ejemplo n.º 1
0
            public override State MoveToReceivingStartedState(EventStreamConsumerStateMachine stm)
            {
                stm.m_uncommittedEventCount = -1;
                stm.m_receivedEventCount    = 0;

                return(Receiving);
            }
Ejemplo n.º 2
0
 public override StreamVersion CalculateConsumedStreamVersion(EventStreamConsumerStateMachine stm, bool skipCurrentEvent)
 {
     return(stm.m_commitedVersion.Increment(
                skipCurrentEvent
             ? stm.m_uncommittedEventCount
             : stm.m_uncommittedEventCount + 1));
 }
Ejemplo n.º 3
0
            public override State MoveToReceivingCompletedState(EventStreamConsumerStateMachine stm, int eventsCount)
            {
                Require.ZeroOrGreater(eventsCount, "eventsCount");

                stm.m_receivedEventCount = eventsCount;

                return(Received);
            }
Ejemplo n.º 4
0
            public override State MoveToClosedState(EventStreamConsumerStateMachine stm)
            {
                if (stm.m_uncommittedEventCount == -1)
                {
                    stm.m_uncommittedEventCount = 0;
                }

                return(Closed);
            }
Ejemplo n.º 5
0
            public override StreamVersion CalculateConsumedStreamVersion(EventStreamConsumerStateMachine stm, bool skipCurrentEvent)
            {
                if (stm.m_uncommittedEventCount == -1)
                {
                    stm.m_uncommittedEventCount = 0;
                }

                return(stm.m_commitedVersion.Increment(stm.m_uncommittedEventCount + stm.m_receivedEventCount));
            }
Ejemplo n.º 6
0
 public virtual State MoveToClosedState(EventStreamConsumerStateMachine stm)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public override State MoveToConsumedState(EventStreamConsumerStateMachine stm)
 {
     throw new InvalidOperationException("Consumer stream is empty.");
 }
Ejemplo n.º 8
0
 public override State MoveToReceivingStartedState(EventStreamConsumerStateMachine stm)
 {
     throw new InvalidOperationException("Consumer stream is in receiving started state.");
 }
Ejemplo n.º 9
0
 public override void EventProcessingStarted(EventStreamConsumerStateMachine stm)
 {
     stm.m_uncommittedEventCount++;
 }
Ejemplo n.º 10
0
 public override State MoveToReceivingCompletedState(EventStreamConsumerStateMachine stm, int eventsCount)
 {
     throw new InvalidOperationException("Consumer stream is in receiving state.");
 }
Ejemplo n.º 11
0
 public virtual StreamVersion CalculateConsumedStreamVersion(EventStreamConsumerStateMachine stm, bool skipCurrentEvent)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 12
0
 public virtual void ConsumedStreamVersionCommited(EventStreamConsumerStateMachine stm, StreamVersion version, bool skipCurrent)
 {
     stm.m_commitedVersion       = version;
     stm.m_uncommittedEventCount = skipCurrent ? 0 : -1;
 }
Ejemplo n.º 13
0
 public virtual void EventProcessingStarted(EventStreamConsumerStateMachine stm)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 14
0
            public override State MoveToConsumedState(EventStreamConsumerStateMachine stm)
            {
                stm.m_uncommittedEventCount++;

                return(Consumed);
            }
Ejemplo n.º 15
0
 public override State MoveToClosedState(EventStreamConsumerStateMachine stm)
 {
     return(Closed);
 }
Ejemplo n.º 16
0
 public override State MoveToReceivingStartedState(EventStreamConsumerStateMachine stm)
 {
     return(Receiving);
 }
Ejemplo n.º 17
0
 public virtual State MoveToReceivingCompletedState(EventStreamConsumerStateMachine stm, int eventsCount)
 {
     throw new NotImplementedException();
 }