Beispiel #1
0
        public void Dispose()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            _disposed = true;

            _heartbeatTimer?.Dispose();
            _heartbeatTimer = null;

            IEnumerable <ISubscription> subscriptions;

            lock (_subscriptions)
            {
                subscriptions = _subscriptions.Values.ToArray();
            }
            foreach (var subscription in subscriptions)
            {
                subscription.Dispose();
            }

            _outputChannel?.Dispose();

            _logger.Info(() => $"Disposed (clientHostAddress = {ClientHostAddress})");
        }
Beispiel #2
0
        public void Dispose()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(nameof(EloquentClient));
            }

            _disposed = true;

            _sessionAgent.Dispose();
            _eventHandlersRepository.Dispose();
            _outputChannel.Dispose();
            _inputChannel.Dispose();
        }