Method RegisterKeyNotificationCallback
RegisterKeyNotificationCallback(String, CacheItemUpdatedCallback, CacheItemRemovedCallback)
Registers the CacheItemUpdatedCallback and/or CacheItemRemovedCallback for the specified key.
Declaration
[Obsolete("This method is deprecated. 'Please use RegisterCacheNotification(string key, CacheDataNotificationCallback selectiveCacheDataNotificationCallback, EventType eventType, EventDataFilter datafilter)'", false)]
public virtual void RegisterKeyNotificationCallback(string key, CacheItemUpdatedCallback updateCallback, CacheItemRemovedCallback removeCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The cache key used to reference the cache item. |
CacheItemUpdatedCallback | updateCallback | The CacheItemUpdatedCallback that is invoked if the item with the specified key is updated in the cache. |
CacheItemRemovedCallback | removeCallback | The CacheItemRemovedCallback is invoked when the item with the specified key is removed from the cache. |
Remarks
CacheItemUpdatedCallback and/or CacheItemRemovedCallback provided this way are very useful because a client application can show interest in any item already present in the cache. As soon as the item is updated or removed from the cache, the client application is notified and actions can be taken accordingly.