/// <inheritdoc /> public void RemoveNodeMetrics(Host host) { if (!_nodeMetricsCollection.TryRemove(host, out var nodeMetrics)) { return; } _nodeMetricsRegistryCollection.TryRemove(host, out _); nodeMetrics.Dispose(); }
public void RemoveIfExists(IPEndPoint ep) { if (!_hosts.TryRemove(ep, out Host host)) { //The host does not exists return; } host.Down -= OnHostDown; host.Up -= OnHostUp; host.SetAsRemoved(); Removed?.Invoke(host); }
public void RemoveIfExists(IPEndPoint ep) { Host host; if (!_hosts.TryRemove(ep, out host)) { //The host does not exists return; } host.Down -= OnHostDown; host.Up -= OnHostUp; host.SetAsRemoved(); if (Removed != null) { Removed(host); } }