/// <summary> /// Closes a channel, removing it from the message broker. /// </summary> /// <param name="name">The name of the channel to close.</param> public void CloseChannel(string name) { Ensure.NotDisposed(this); ThrowIfChannelDoesNotExist(name); IMessageChannel channel = _channels[name]; channel.Dispose(); _channels.Remove(name); }
void IDisposable.Dispose() { _inputChannel.NewOutMessage -= InputChannelOnNewOutMessage; _outputChannel.NewOutMessage -= OutputChannelOnNewOutMessage; if (OwnInputChannel) { _inputChannel.Dispose(); } if (OwnOutputChannel) { _outputChannel.Dispose(); } _adapter.NewOutMessage -= AdapterOnNewOutMessage; //_adapter.Dispose(); }
public void Dispose() { _messageChannel?.Dispose(); _readerThread?.Dispose(); }