Пример #1
0
 public static BrokerConnection InstanceOf()
 {
     if (_instance == null)
     {
         lock (s_lock)
         {
             if (_instance == null)
             {
                 _instance = new BrokerConnection();
             }
         }
     }
     return _instance;
 }
Пример #2
0
        public void Disconnect()
        {
            foreach (var config in brokerConfigs.Values)
            {
                Subscriber subscriber = new Subscriber(config);
                if (subscriber != null)
                {
                    subscriber.Disconnect();

                    _instance = null;
                }
            }
        }