Ejemplo n.º 1
0
        private void StopReaders()
        {
            if (_subscriptions.Count > 0)
            {
                _logger.Info("_subscriptions is not empty after all the projections have been killed");
                _subscriptions.Clear();
            }

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

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

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

            if (_runHeadingReader)
            {
                _headingEventReader.Stop();
            }
            _stopped = true;
        }
Ejemplo n.º 2
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));
        }