Exemple #1
0
        private void CacheCancellableTokensRegistry_OnTokenCancelled(TokenCancelledEventArgs e)
        {
            var message = new RedisCachingMessage {
                InstanceId = _instanceId, IsToken = true, CacheKeys = new[] { e.TokenKey }
            };

            Publish(message);
            _log.LogTrace($"Published token cancellation message {message.ToString()}");
        }
Exemple #2
0
        protected override void EvictionCallback(object key, object value, EvictionReason reason, object state)
        {
            _log.LogInformation($"{nameof(RedisPlatformMemoryCache)}: channel[{_redisCachingOptions.ChannelName }] sending a message with key:{key} from instance:{ _cacheId } to all subscribers");
            
            var message = new RedisCachingMessage { Id = _cacheId, CacheKeys = new[] { key } };
            _bus.Publish(_redisCachingOptions.ChannelName, JsonConvert.SerializeObject(message), CommandFlags.FireAndForget);

            base.EvictionCallback(key, value, reason, state);
        }
Exemple #3
0
        protected override void EvictionCallback(object key, object value, EvictionReason reason, object state)
        {
            var message = new RedisCachingMessage {
                InstanceId = _instanceId, CacheKeys = new[] { key }
            };

            Publish(message);
            _log.LogTrace($"Published message {message} to the Redis backplane");

            base.EvictionCallback(key, value, reason, state);
        }
Exemple #4
0
 private void Publish(RedisCachingMessage message)
 {
     EnsureRedisServerConnection();
     _bus.Publish(_redisCachingOptions.ChannelName, JsonConvert.SerializeObject(message), CommandFlags.FireAndForget);
 }