public void FinalizeEventProcessing(
            EventProcessedResult result, CheckpointTag eventCheckpointTag, float progress)
        {
            if (_state == PhaseState.Running)
            {
                //TODO: move to separate projection method and cache result in work item
                if (result != null)
                {
                    _resultWriter.AccountPartition(result);
                    if (_projectionConfig.EmitEventEnabled && result.EmittedEvents != null)
                    {
                        _resultWriter.EventsEmitted(
                            result.EmittedEvents, result.CausedBy, result.CorrelationId);
                        _emittedStreamsTracker.TrackEmittedStream(result.EmittedEvents.Select(x => x.Event).ToArray());
                    }

                    if (result.NewState != null)
                    {
                        _resultWriter.WriteRunningResult(result);
                        _checkpointManager.StateUpdated(result.Partition, result.OldState, result.NewState);
                    }

                    if (result.NewSharedState != null)
                    {
                        _checkpointManager.StateUpdated("", result.OldSharedState, result.NewSharedState);
                    }
                }

                _checkpointManager.EventProcessed(eventCheckpointTag, progress);
                _progressResultWriter.WriteProgress(progress);
            }
        }
Esempio n. 2
0
 public void AccountPartition(EventProcessedResult result)
 {
     if (_producesRunningResults)
         if (result.Partition != "" && result.OldState.CausedBy == _zeroCheckpointTag)
         {
             var resultEvents = RegisterNewPartition(result.Partition, result.CheckpointTag);
             if (resultEvents != null)
                 _coreProjectionCheckpointManager.EventsEmitted(
                     resultEvents, Guid.Empty, correlationId: null);
         }
 }
Esempio n. 3
0
 public void AccountPartition(EventProcessedResult result)
 {
     if (_producesRunningResults)
     {
         if (result.Partition != "" && result.OldState.CausedBy == _zeroCheckpointTag)
         {
             var resultEvents = RegisterNewPartition(result.Partition, result.CheckpointTag);
             if (resultEvents != null)
             {
                 _coreProjectionCheckpointManager.EventsEmitted(resultEvents, Guid.Empty, correlationId: null);
             }
         }
     }
 }
Esempio n. 4
0
 public void WriteRunningResult(EventProcessedResult result)
 {
     if (!_producesRunningResults)
         return;
     var oldState = result.OldState;
     var newState = result.NewState;
     var resultBody = newState.Result;
     if (oldState.Result != resultBody)
     {
         var partition = result.Partition;
         var causedBy = newState.CausedBy;
         WriteResult(partition, resultBody, causedBy, result.CausedBy, result.CorrelationId);
     }
 }
Esempio n. 5
0
        public void WriteRunningResult(EventProcessedResult result)
        {
            if (!_producesRunningResults)
            {
                return;
            }
            var oldState   = result.OldState;
            var newState   = result.NewState;
            var resultBody = newState.Result;

            if (oldState.Result != resultBody)
            {
                var partition = result.Partition;
                var causedBy  = newState.CausedBy;
                WriteResult(partition, resultBody, causedBy, result.CausedBy, result.CorrelationId);
            }
        }
 private void SetEventProcessedResult(EventProcessedResult eventProcessedResult)
 {
     _eventProcessedResult = eventProcessedResult;
 }
 private void SetEventProcessedResult(EventProcessedResult eventProcessedResult)
 {
     _eventProcessedResult = eventProcessedResult;
 }
 public void AccountPartition(EventProcessedResult result)
 {
     // intentionally does nothing
 }
 public void WriteRunningResult(EventProcessedResult result)
 {
     // intentionally does nothing
 }
Esempio n. 10
0
 public void AccountPartition(EventProcessedResult result)
 {
     // intentionally does nothing            
 }
Esempio n. 11
0
 public void WriteRunningResult(EventProcessedResult result)
 {
     // intentionally does nothing            
 }