示例#1
0
        public void Dispose()
        {
            //NOTE: Sometimes, disposing the channel blocks current thread
            var task = Task.Factory.StartNew(() => _createdChannels.ForEach(DisposeChannel), Global.DefaultTaskCreationOptionsProvider());

            task.ContinueWith(t => _createdChannels.Clear(), Global.DefaultTaskContinuationOptionsProvider());

            if (_connection.IsConnected)
            {
                _connection.Dispose();
            }
            _consumerManager.Dispose();
        }
示例#2
0
 protected virtual void DisposeConsumerManager()
 {
     _consumerManager.Dispose();
 }
 public void Dispose() => _consumerManager.Dispose();