コード例 #1
0
ファイル: ResultWriter.cs プロジェクト: tubo70/EventStore
        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);
            }
        }
コード例 #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();
        }