public static IConfigurationBuilder AddRedis(this IConfigurationBuilder builder, string key, CancellationToken cancellationToken, Action <IRedisConfigurationSource> options)
        {
            var source = new RedisConfigurationSource(key, cancellationToken);

            options(source);

            return(builder.Add(source));
        }
Example #2
0
        public RedisConfigurationProvider(RedisConfigurationSource source, RedisConfigurationClient client)
        {
            _source = source;
            _redisConfigurationClient = client;

            ChangeToken.OnChange(
                () => _redisConfigurationClient.Watch(_source.OnWatchException),
                async() =>
            {
                await DoLoad(reloading: true);
                OnReload();
                _source.OnReload?.Invoke();
            });
        }
 public RedisConfigurationClient(RedisConfigurationSource source)
 {
     _source = source;
 }