public virtual void Dispose() { // Stop the broker from doing any work _broker.Dispose(); // Spin while we wait for the timer to finish if it's currently running while (Interlocked.Exchange(ref _gcRunning, 1) == 1) { Thread.Sleep(250); } // Remove all topics _topics.Clear(); if (_gcTimer != null) { _gcTimer.Dispose(); } }
public virtual void Dispose() { _broker.Dispose(); }