Пример #1
0
        static void CreateInstance(Configuration configuration, User user)
        {
            if (Instance != null)
            {
                throw new Exception("LdClient instance already exists.");
            }

            Instance = new LdClient(configuration, user);
            Log.InfoFormat("Initialized LaunchDarkly Client {0}",
                           Instance.Version);
        }
Пример #2
0
        static LdClient CreateInstance(Configuration configuration, User user)
        {
            lock (_createInstanceLock)
            {
                if (_instance != null)
                {
                    throw new Exception("LdClient instance already exists.");
                }

                var c = new LdClient(configuration, user);
                _instance = c;
                Log.InfoFormat("Initialized LaunchDarkly Client {0}", Version);
                return(c);
            }
        }
Пример #3
0
        static void CreateInstance(Configuration configuration, User user)
        {
            if (Instance != null)
            {
                throw new Exception("LdClient instance already exists.");
            }

            Instance = new LdClient(configuration, user);
            Log.InfoFormat("Initialized LaunchDarkly Client {0}",
                           Instance.Version);

            TimeSpan?bgPollInterval = null;

            if (configuration.EnableBackgroundUpdating)
            {
                bgPollInterval = configuration.BackgroundPollingInterval;
            }
            Instance.platformAdapter.EnableBackgrounding(new LdClientBackgroundingState(Instance), bgPollInterval);
        }