Example #1
0
        private void StopReaders(ReaderCoreServiceMessage.StopReader message)
        {
            if (_eventReaders.TryGetValue(_defaultEventReaderId, out var eventReader))
            {
                eventReader.Dispose();
                _eventReaders.Remove(_defaultEventReaderId);
                _eventReaderSubscriptions.Remove(_defaultEventReaderId);
            }
            _defaultEventReaderId = Guid.Empty;

            if (_subscriptions.Count > 0)
            {
                _logger.Information("_subscriptions is not empty after all the projections have been killed");
                _subscriptions.Clear();
            }

            if (_eventReaders.Count > 0)
            {
                _logger.Information("_eventReaders is not empty after all the projections have been killed");
                _eventReaders.Clear();
            }

            if (_subscriptionEventReaders.Count > 0)
            {
                _logger.Information("_subscriptionEventReaders is not empty after all the projections have been killed");
                _subscriptionEventReaders.Clear();
            }

            if (_eventReaderSubscriptions.Count > 0)
            {
                _logger.Information("_eventReaderSubscriptions is not empty after all the projections have been killed");
                _eventReaderSubscriptions.Clear();
            }

            if (_runHeadingReader)
            {
                _headingEventReader.Stop();
            }
            _stopped = true;

            _publisher.Publish(
                new ProjectionCoreServiceMessage.SubComponentStopped(SubComponentName, message.QueueId));
        }
Example #2
0
 public void Handle(ReaderCoreServiceMessage.StopReader message)
 {
     StopReaders();
 }
Example #3
0
 public void Handle(ReaderCoreServiceMessage.StopReader message)
 {
     StopReaders();
     _publisher.Publish(new ProjectionCoreServiceMessage.SubComponentStopped("EventReaderCoreService"));
 }