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

            foreach (var connection in Connections)
            {
                connection.Value.SendTopologyChanges(topologyChange);
            }
        }
Exemplo n.º 3
0
        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
                });
            }
        }