示例#1
0
 public DistributedInterceptCache(IOptions <LmsDistributedCacheOptions> distributedCacheOption,
                                  IDistributedCache cache,
                                  ICancellationTokenProvider cancellationTokenProvider,
                                  IDistributedCacheSerializer serializer,
                                  IDistributedCacheKeyNormalizer keyNormalizer)
     : base(distributedCacheOption, cache, cancellationTokenProvider, serializer, keyNormalizer)
 {
 }
示例#2
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     IDistributedCacheKeyNormalizer keyNormalizer) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         keyNormalizer: keyNormalizer)
 {
 }
        public StackExchangeRedisCacheItemManager(
            IDistributedCache distributedCache,
            IDistributedCacheKeyNormalizer keyNormalizer,
            ICancellationTokenProvider cancellationTokenProvider)
        {
            if (distributedCache is not RedisCache redisCache)
            {
                throw new DistributedCacheProviderInvalidException();
            }

            _redisCache                = redisCache;
            _keyNormalizer             = keyNormalizer;
            _cancellationTokenProvider = cancellationTokenProvider;
        }
示例#4
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     IDistributedCacheKeyNormalizer keyNormalizer,
     IHybridServiceScopeFactory serviceScopeFactory) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         keyNormalizer: keyNormalizer,
         serviceScopeFactory: serviceScopeFactory)
 {
 }
示例#5
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     IDistributedCacheKeyNormalizer keyNormalizer,
     IServiceScopeFactory serviceScopeFactory,
     IUnitOfWorkManager unitOfWorkManager) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         keyNormalizer: keyNormalizer,
         serviceScopeFactory: serviceScopeFactory,
         unitOfWorkManager: unitOfWorkManager)
 {
 }
示例#6
0
        public DistributedCache(
            IOptions <LmsDistributedCacheOptions> distributedCacheOption,
            IDistributedCache cache,
            ICancellationTokenProvider cancellationTokenProvider,
            IDistributedCacheSerializer serializer,
            IDistributedCacheKeyNormalizer keyNormalizer)
        {
            _distributedCacheOption = distributedCacheOption.Value;
            Cache = cache;
            CancellationTokenProvider = cancellationTokenProvider;
            Logger        = NullLogger <DistributedCache <TCacheItem, TCacheKey> > .Instance;
            Serializer    = serializer;
            KeyNormalizer = keyNormalizer;

            SyncSemaphore = new SemaphoreSlim(1, 1);

            SetDefaultOptions();
        }
        public StackExchangeRedisCacheItemManager(
            IDistributedCache distributedCache,
            IDistributedCacheKeyNormalizer keyNormalizer,
            ICancellationTokenProvider cancellationTokenProvider,
            IConfiguration configuration)
        {
            if (!(distributedCache is RedisCache))
            {
                throw new DistributedCacheProviderInvalidException();
            }

            _distributedCache          = distributedCache;
            _keyNormalizer             = keyNormalizer;
            _cancellationTokenProvider = cancellationTokenProvider;

            var options = ConfigurationOptions.Parse(configuration["Redis:Configuration"]);

            options.AllowAdmin = true;

            _connectionMultiplexer = ConnectionMultiplexer.Connect(options);
        }