コード例 #1
0
        public void Handle(ProjectionSubscriptionMessage.CheckpointSuggested 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) && _projectionConfig.CheckpointsEnabled)
                {
                    CheckpointTag checkpointTag = message.CheckpointTag;
                    var           checkpointSuggestedWorkItem = new CheckpointSuggestedWorkItem(this, message, _checkpointManager);
                    _processingQueue.EnqueueTask(checkpointSuggestedWorkItem, checkpointTag);
                }
                _processingQueue.ProcessEvent();
            }
            catch (Exception ex)
            {
                SetFaulted(ex);
            }
        }
コード例 #2
0
 public void SetCurrentCheckpointSuggestedWorkItem(CheckpointSuggestedWorkItem checkpointSuggestedWorkItem)
 {
     if (_checkpointSuggestedWorkItem != null && checkpointSuggestedWorkItem != null)
         throw new InvalidOperationException("Checkpoint in progress");
     if (_checkpointSuggestedWorkItem == null && checkpointSuggestedWorkItem == null)
         throw new InvalidOperationException("No checkpoint in progress");
     _checkpointSuggestedWorkItem = checkpointSuggestedWorkItem;
 }
コード例 #3
0
 private void CompleteCheckpointSuggestedWorkItem()
 {
     var workItem = _checkpointSuggestedWorkItem;
     if (workItem != null) {
         _checkpointSuggestedWorkItem = null;
         workItem.CheckpointCompleted();
         EnsureTickPending();
     }
 }
        public void Handle(EventReaderSubscriptionMessage.CheckpointSuggested message)
        {
            if (IsOutOfOrderSubscriptionMessage(message))
            {
                return;
            }
            RegisterSubscriptionMessage(message);
            try {
                if (_useCheckpoints)
                {
                    CheckpointTag checkpointTag = message.CheckpointTag;
                    var           checkpointSuggestedWorkItem =
                        new CheckpointSuggestedWorkItem(this, message, _checkpointManager);
                    _processingQueue.EnqueueTask(checkpointSuggestedWorkItem, checkpointTag,
                                                 allowCurrentPosition: true);
                }

                ProcessEvent();
            } catch (Exception ex) {
                _coreProjection.SetFaulted(ex);
            }
        }
 public void SetCurrentCheckpointSuggestedWorkItem(CheckpointSuggestedWorkItem checkpointSuggestedWorkItem)
 {
     _coreProjection.SetCurrentCheckpointSuggestedWorkItem(checkpointSuggestedWorkItem);
 }