Beispiel #1
0
 public void Handle(CoreProjectionManagementMessage.GetState message)
 {
     try
     {
         var getStateWorkItem = new GetStateWorkItem(
             message.Envelope, message.CorrelationId, message.ProjectionId, this, message.Partition);
         _processingQueue.EnqueueOutOfOrderTask(getStateWorkItem);
         ProcessEvent();
     }
     catch (Exception ex)
     {
         message.Envelope.ReplyWith(
             new CoreProjectionManagementMessage.StateReport(
                 message.CorrelationId, _projectionCorrelationId, message.Partition, state: null, position: null,
                 exception: ex));
         _coreProjection.SetFaulted(ex);
     }
 }
Beispiel #2
0
 public void Handle(CoreProjectionManagementMessage.GetState message)
 {
     EnsureState(
         State.Running | State.Paused | State.Stopping | State.Stopped | State.FaultedStopping | State.Faulted);
     try
     {
         if (_state == State.Running || _state == State.Paused)
         {
             var getStateWorkItem = new GetStateWorkItem(message.Envelope, message.CorrelationId, this, _partitionStateCache, message.Partition);
             _processingQueue.EnqueueOutOfOrderTask(getStateWorkItem);
         }
         _processingQueue.ProcessEvent();
     }
     catch (Exception ex)
     {
         SetFaulted(ex);
     }
 }