Exemplo n.º 1
0
        private void WriteResult(
            string partition, string resultBody, CheckpointTag causedBy, Guid causedByGuid, string correlationId)
        {
            var resultEvents = ResultUpdated(partition, resultBody, causedBy);

            if (resultEvents != null)
            {
                _coreProjectionCheckpointManager.EventsEmitted(resultEvents, causedByGuid, correlationId);
            }
        }
Exemplo n.º 2
0
        public void ProcessEvent()
        {
            if (!_subscribed)
            {
                throw new InvalidOperationException();
            }
            if (_projectionState != PhaseState.Running)
            {
                return;
            }

            var phaseCheckpointTag = CheckpointTag.FromPhase(_phase, completed: true);
            var writeResults       = WriteResults(phaseCheckpointTag);

            var writeEofResults = WriteEofEvent(phaseCheckpointTag);

            _emittedEventWriter.EventsEmitted(writeResults.Concat(writeEofResults).ToArray(), Guid.Empty, null);

            _checkpointManager.EventProcessed(phaseCheckpointTag, 100.0f);
            _coreProjection.CompletePhase();
        }