关于从Azure缓存接收通知的说明
我正在努力在基于Azure角色的专用缓存上添加/替换项目时启用通知。我遵循了下面提供的MSDN链接的说明 应用程序在添加和替换项上接收应用程序。但是,我注意到,当您对给定操作执行add或replace N次时,回调函数将执行N次 e、 g。 第一次添加时,会触发一次AddItem操作的通知 第二个Addsame键,delegateID为1和2的ReplaceItem操作会触发两次通知 第三个Addsame键,对于DelegateID为1、2和3的ReplaceItem操作,会触发3次通知 有人能帮我理解为什么每次添加/替换项目时,通知会被触发N次 谢谢关于从Azure缓存接收通知的说明,azure,notifications,azure-caching,Azure,Notifications,Azure Caching,我正在努力在基于Azure角色的专用缓存上添加/替换项目时启用通知。我遵循了下面提供的MSDN链接的说明 应用程序在添加和替换项上接收应用程序。但是,我注意到,当您对给定操作执行add或replace N次时,回调函数将执行N次 e、 g。 第一次添加时,会触发一次AddItem操作的通知 第二个Addsame键,delegateID为1和2的ReplaceItem操作会触发两次通知 第三个Addsame键,对于DelegateID为1、2和3的ReplaceItem操作,会触发3次通知 有人能
//specify all possible item and region operations
DataCacheOperations allCacheOperations = DataCacheOperations.AddItem |
DataCacheOperations.ReplaceItem;
DataCacheNotificationDescriptor ndCacheLvlAllOps
= myTestCache.AddItemLevelCallback(allCacheOperations, myCacheLvlDelegate);
public void myCacheLvlDelegate(string myCacheName,
string myRegion,
string myKey,
DataCacheItemVersion itemVersion,
DataCacheOperations OperationId,
DataCacheNotificationDescriptor nd)
{
//display some of the delegate parameters
Console.WriteLine("A cache-level notification was triggered!");
Console.WriteLine(" Cache: " + myCacheName);
Console.WriteLine(" Region: " + myRegion);
Console.WriteLine(" Key: " + myKey);
Console.WriteLine(" Operation: " + OperationId.ToString());
Console.WriteLine(" DeligateID" + nd.DelegateID.ToString());
Console.WriteLine();
}