Exemplo n.º 1
0
        /// <inheritdoc />
        public void RemoveNodeMetrics(Host host)
        {
            if (!_nodeMetricsCollection.TryRemove(host, out var nodeMetrics))
            {
                return;
            }

            _nodeMetricsRegistryCollection.TryRemove(host, out _);
            nodeMetrics.Dispose();
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        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);
            }
        }