コード例 #1
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 /// <filterpriority>2</filterpriority>
 public void Dispose()
 {
     if (Interlocked.Exchange(ref _state, 2) == 1)
     {
         _messageQueue.Dispose();
         _subscribers.Clear();
     }
 }
コード例 #2
0
 public void Dispose()
 {
     _host.Down -= OnHostDown;
     _host.Up   -= OnHostUp;
     if (_connections.Count == 0)
     {
         return;
     }
     Logger.Info(String.Format("Disposing connection pool to {0}, closing {1} connections.", _host.Address, _connections.Count));
     _poolModificationSemaphore.Wait();
     foreach (var c in _connections)
     {
         c.Dispose();
     }
     _connections.Clear();
     _poolModificationSemaphore.Release();
     _poolModificationSemaphore.Dispose();
 }
コード例 #3
0
 public void RemoveListeners()
 {
     listenersLazy?.Clear();
 }