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(); }
protected virtual void DisposeConsumerManager() { _consumerManager.Dispose(); }
public void Dispose() => _consumerManager.Dispose();