private FeatureflowClient(string apiKey, IEnumerable <Feature> defaultFeatures, FeatureflowConfig config)
        {
            _config = config ?? new FeatureflowConfig();
            _featureControlCache = new SimpleMemoryFeatureCache();

            InitializeDefaultFeatures(defaultFeatures);

            if (!_config.Offline)
            {
                var restConfig = new RestConfig
                {
                    SdkVersion = ((AssemblyInformationalVersionAttribute)typeof(FeatureflowClient)
                                  .GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyInformationalVersionAttribute))).InformationalVersion
                };

                _restClient   = new RestClient(apiKey, _config, restConfig);
                _eventsClient = new FeatureflowEventsClient(_restClient, _config);

                switch (_config.GetFeaturesMethod)
                {
                case GetFeaturesMethod.Polling:
                    _pollingClient = new PollingClient(_config, _featureControlCache, _restClient);
                    _pollingClient.FeatureUpdated += OnFeatureUpdated;
                    _pollingClient.FeatureDeleted += OnFeatureDeleted;
                    break;

                case GetFeaturesMethod.Sse:
                    _streamClient = new FeatureflowStreamClient(_config, _featureControlCache, _restClient);
                    _streamClient.FeatureUpdated += OnFeatureUpdated;
                    _streamClient.FeatureDeleted += OnFeatureDeleted;
                    break;
                }
            }
        }
 internal Evaluate(FeatureControl control, User user, string failoverVariant, FeatureflowEventsClient featureflowEventsClient)
 {
     _featureflowEventsClient = featureflowEventsClient;
     _control        = control;
     _user           = user;
     _evaluateResult = _control == null ? failoverVariant : CalculateVariant(_control, _user);
 }