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);
            }
        }
Ejemplo 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);
         }
 }
Ejemplo 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);
             }
         }
     }
 }
Ejemplo 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);
     }
 }
Ejemplo 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;
 }
Ejemplo n.º 7
0
 private void SetEventProcessedResult(EventProcessedResult eventProcessedResult)
 {
     _eventProcessedResult = eventProcessedResult;
 }
 public void AccountPartition(EventProcessedResult result)
 {
     // intentionally does nothing
 }
 public void WriteRunningResult(EventProcessedResult result)
 {
     // intentionally does nothing
 }
Ejemplo n.º 10
0
 public void AccountPartition(EventProcessedResult result)
 {
     // intentionally does nothing            
 }
Ejemplo n.º 11
0
 public void WriteRunningResult(EventProcessedResult result)
 {
     // intentionally does nothing            
 }