public void SendTopologyChanges(TopologyChange change)
 {
     if (_watchTopology)
     {
         Send(change);
     }
 }
Esempio n. 2
0
        public void RaiseNotifications(TopologyChange topologyChange)
        {
            OnTopologyChange?.Invoke(topologyChange);

            foreach (var connection in Connections)
            {
                connection.Value.SendTopologyChanges(topologyChange);
            }
        }
        private void Send(TopologyChange change)
        {
            var value = new DynamicJsonValue
            {
                ["Type"]  = nameof(TopologyChange),
                ["Value"] = change.ToJson()
            };

            if (_disposeToken.IsCancellationRequested == false)
            {
                _sendQueue.Enqueue(new ChangeValue
                {
                    ValueToSend = value,
                    AllowSkip   = true
                });
            }
        }