Beispiel #1
0
 public static CallServer getCallServer(string zooKeeperURL)
 {
     if (_zk == null)
     {
         lock (_locker)
         {
             if (_zk == null)
             {
                 _zk = new CallServer(zooKeeperURL);
             }
         }
     }
     return(_zk);
 }
Beispiel #2
0
        public static string getTokenAuthAddress(string zooKeeperURL)
        {
            CallServer       zk      = CallTokenAuth.getCallServer(zooKeeperURL);
            TokenAuthWatcher watcher = CallTokenAuth.getWatcher(zooKeeperURL);
            string           ipport  = zk.getChild($"/{NodeName.TokenAuth}", Guid.NewGuid().ToString(), watcher);

            if (string.IsNullOrWhiteSpace(ipport))
            {
                return("");
            }
            else
            {
                return($"{http}://{ipport}");
            }
        }
Beispiel #3
0
 public void Dispose()
 {
     _zk      = null;
     _watcher = null;
 }
Beispiel #4
0
 public void Dispose()
 {
     _authAPIzk      = null;
     _authAPIwatcher = null;
 }