コード例 #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();
            }
        }
コード例 #2
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();
            }
        }