Exemplo n.º 1
0
 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);
             }
             if (result.NewState != null)
             {
                 _resultWriter.WriteRunningResult(result);
                 _checkpointManager.StateUpdated(result.Partition, result.OldState, result.NewState);
             }
         }
         _checkpointManager.EventProcessed(eventCheckpointTag, progress);
     }
 }