Beispiel #1
0
        private void openConnectionIfNeeded()
        {
            lock (_openConnectionLock)
            {
                if (client == null)
                {
                    client = (CuratorFrameworkImpl)factory.build(); // cast is safe - we control both sides of this
                    client.start();
                }
                cleanup = ThreadUtils.newSingleThreadScheduledExecutor("CuratorTempFrameworkImpl");

                IRunnable command = RunnableUtils.FromFunc(checkInactive);
                cleanup.scheduleAtFixedRate(command, inactiveThresholdMs, inactiveThresholdMs);
                updateLastAccess();
            }
        }
        private void openConnectionIfNeeded()
        {
            lock (_openConnectionLock)
            {
                if ( client == null )
                {
                    client = (CuratorFrameworkImpl)factory.build(); // cast is safe - we control both sides of this
                    client.start();
                }
                cleanup = ThreadUtils.newSingleThreadScheduledExecutor("CuratorTempFrameworkImpl");

                IRunnable command = RunnableUtils.FromFunc(checkInactive);
                cleanup.scheduleAtFixedRate(command, inactiveThresholdMs, inactiveThresholdMs);
                updateLastAccess();
            }
        }