/// <summary> /// Attempt to stop the worker thread gracefully, giving it time to finish handling and acking a message. /// After a certain timeout, give up and dispose of the worker thread forcefully. /// </summary> public void Dispose() { lock (this) { if (_disposing) { return; } _disposing = true; } _messaging.Cancel(); if (_worker == null) { return; } _worker.Join(2000); _messaging.Dispose(); _worker.Join(2000); _worker = null; }
/// <summary> /// Release resources being used by the RPC client /// </summary> public void Dispose() { _messaging.Cancel(); _messaging.Dispose(); }