public override State MoveToReceivingStartedState(EventStreamConsumerStateMachine stm) { stm.m_uncommittedEventCount = -1; stm.m_receivedEventCount = 0; return(Receiving); }
public override StreamVersion CalculateConsumedStreamVersion(EventStreamConsumerStateMachine stm, bool skipCurrentEvent) { return(stm.m_commitedVersion.Increment( skipCurrentEvent ? stm.m_uncommittedEventCount : stm.m_uncommittedEventCount + 1)); }
public override State MoveToReceivingCompletedState(EventStreamConsumerStateMachine stm, int eventsCount) { Require.ZeroOrGreater(eventsCount, "eventsCount"); stm.m_receivedEventCount = eventsCount; return(Received); }
public override State MoveToClosedState(EventStreamConsumerStateMachine stm) { if (stm.m_uncommittedEventCount == -1) { stm.m_uncommittedEventCount = 0; } return(Closed); }
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)); }
public virtual State MoveToClosedState(EventStreamConsumerStateMachine stm) { throw new NotImplementedException(); }
public override State MoveToConsumedState(EventStreamConsumerStateMachine stm) { throw new InvalidOperationException("Consumer stream is empty."); }
public override State MoveToReceivingStartedState(EventStreamConsumerStateMachine stm) { throw new InvalidOperationException("Consumer stream is in receiving started state."); }
public override void EventProcessingStarted(EventStreamConsumerStateMachine stm) { stm.m_uncommittedEventCount++; }
public override State MoveToReceivingCompletedState(EventStreamConsumerStateMachine stm, int eventsCount) { throw new InvalidOperationException("Consumer stream is in receiving state."); }
public virtual StreamVersion CalculateConsumedStreamVersion(EventStreamConsumerStateMachine stm, bool skipCurrentEvent) { throw new NotImplementedException(); }
public virtual void ConsumedStreamVersionCommited(EventStreamConsumerStateMachine stm, StreamVersion version, bool skipCurrent) { stm.m_commitedVersion = version; stm.m_uncommittedEventCount = skipCurrent ? 0 : -1; }
public virtual void EventProcessingStarted(EventStreamConsumerStateMachine stm) { throw new NotImplementedException(); }
public override State MoveToConsumedState(EventStreamConsumerStateMachine stm) { stm.m_uncommittedEventCount++; return(Consumed); }
public override State MoveToClosedState(EventStreamConsumerStateMachine stm) { return(Closed); }
public override State MoveToReceivingStartedState(EventStreamConsumerStateMachine stm) { return(Receiving); }
public virtual State MoveToReceivingCompletedState(EventStreamConsumerStateMachine stm, int eventsCount) { throw new NotImplementedException(); }