Ejemplo n.º 1
0
 public FeaturesController(
     IEditableFeatureFlagStorageService storage,
     IFeatureFlagCacheService cache,
     IAppConfiguration config)
 {
     _storage = storage ?? throw new ArgumentNullException(nameof(storage));
     _cache   = cache ?? throw new ArgumentNullException(nameof(cache));
     _config  = config ?? throw new ArgumentNullException(nameof(config));
 }
Ejemplo n.º 2
0
        private static void StartFeatureFlags(IFeatureFlagCacheService featureFlags)
        {
            // Try to load the feature flags once at startup.
            try
            {
                featureFlags.RefreshAsync().Wait();
            }
            catch (Exception)
            {
            }

            // Continuously refresh the feature flags in the background.
            HostingEnvironment.QueueBackgroundWorkItem(featureFlags.RunAsync);
        }
Ejemplo n.º 3
0
 public FeatureFlagClient(IFeatureFlagCacheService cache, ILogger <FeatureFlagClient> logger)
 {
     _cache  = cache ?? throw new ArgumentNullException(nameof(cache));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }