Esempio n. 1
0
 public static void Init(string host, string rootNode)
 {
     lock (SyncRoot)
     {
         _host     = host;
         _rootNode = rootNode;
         _client   = new ZooKeeperClient();
         _client.Connect(host);
     }
 }
        public static ZooKeeperClient GetZooKeeperClient(string host)
        {
            if (string.IsNullOrWhiteSpace(host))
            {
                throw new ArgumentNullException("host");
            }

            return(Clients.GetOrSet(host, () =>
            {
                ZooKeeperClient client = new ZooKeeperClient();
                client.Connect(host);
                return client;
            }));
        }