Skip to content

Redis Key Space Notifications support for DEL event #148

@vinogmca

Description

@vinogmca

We are using your library for our caching mechanism (Redis as Back plane with In-Memory Handle). First of all, We would like to thank for your fantastic implementation. Now we need your help on addressing an weird issue on Key space notifications part.

We believe the current version of cache manager subscribed for "Expire" and "Evict" events. We are using Redis admin desk top tool (https://redisdesktop.com) for managing the keys (i.e) if somebody wants to remove/filter specific key inside our team they can use this to do. Problem here is when an item is removed(manual redis key deletion) from an external such as the Redis Desktop Manager, that all of the applications using the cacheitem are not being notified(CacheManager library not subscribed for Key event DEL).When we try to add subscription for Key event DEL (@_KeyEvent@db_del) in our application

connection.GetSubscriber().Subscribe(string.Format("__keyevent@{0}__:del", redisConfiguration.Database),
(channel, key) =>
{
   InvalidateObject(key); // This will call CacheManager.Remove()
});

and it calls your library for removal(to ensure the sync between redis and in-memory) But by seeing your implementation on Remove() you will be calling KeyDelete()(i.e) CacheManager.Remove()=>KeyDelete()=>@_KeyEvent@db_del subscribed in our application=>CacheManager.Remove() (big cascade). We know it's not the right way to achieve what we want. But we definitely want a solution to notify the application when cache item being removed via external tool.

Thanks in advance !!!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions