public void Handle(EventReaderSubscriptionMessage.ProgressChanged message)
 {
     if (IsOutOfOrderSubscriptionMessage(message))
     {
         return;
     }
     RegisterSubscriptionMessage(message);
     try {
         var progressWorkItem =
             new ProgressWorkItem(_checkpointManager, _progressResultWriter, message.Progress);
         _processingQueue.EnqueueTask(progressWorkItem, message.CheckpointTag, allowCurrentPosition: true);
         ProcessEvent();
     } catch (Exception ex) {
         _coreProjection.SetFaulted(ex);
     }
 }
Beispiel #2
0
        public void Handle(ProjectionSubscriptionMessage.ProgressChanged message)
        {
            if (IsOutOfOrderSubscriptionMessage(message))
            {
                return;
            }
            RegisterSubscriptionMessage(message);

            EnsureState(
                State.Running | State.Paused | State.Stopping | State.Stopped | State.FaultedStopping | State.Faulted);
            try
            {
                if (_state == State.Running || _state == State.Paused)
                {
                    var progressWorkItem = new ProgressWorkItem(this, _checkpointManager, message.Progress);
                    _processingQueue.EnqueueTask(progressWorkItem, message.CheckpointTag, allowCurrentPosition: true);
                }
                _processingQueue.ProcessEvent();
            }
            catch (Exception ex)
            {
                SetFaulted(ex);
            }
        }