Пример #1
0
 public static void CleanKey(string key, bool sync = true)
 {
     CacheProvider.Provider.Remove(key);
     if (sync)
     {
         var msg = CacheSyncMsg.CreateRemoveMsg(_sender, key);
         _subscriber.Publish(_channel, DynamicJson.Serialize(msg));
     }
 }
Пример #2
0
        public void Remove(string key)
        {
            _keys.TryRemove(key, out bool value);
            _storage.Remove(key);

            var msg = CacheSyncMsg.CreateRemoveMsg(_self, key);

            _subscriber.Publish(_channel, DynamicJson.Serialize(msg));

            Console.WriteLine("Removed:" + key);
        }