• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Delegate DataTypeDataNotificationCallback

Defines a callback method for notifying applications when a distributed collection is updated in the cache.

Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public delegate void DataTypeDataNotificationCallback(string collectionName, DataTypeEventArg collectionEventArgs);
Parameters
Type Name Description
System.String collectionName

The name of collection used to reference it.

DataTypeEventArg collectionEventArgs

The collection event arguments.

Remarks

Since this handler is invoked every time a distributed collection is updated in the cache, doing a lot of processing inside the handler might have an impact on the performance of the cache and cluster. It is therefore, advisable to do minimal processing inside the handler.

Examples

The following example demonstrates how to use the DataTypeDataNotificationCallback class to notify an application when a collection is updated to the application's cache object. You could include this code in a code declaration block in the Web Forms page, or in a page code-behind file.

public static void OnCollectionDataModification(string collectionName, CollectionEventArg collectionEventArgs)
{
     //
}

protected void Application_Start(object sender, EventArgs e)
{
    try
    {
        NCache.InitializeCache("demoClusteredCache");
        CollectionDataNotificationCallback callback = new CollectionDataNotificationCallback(OnCacheDataModification);
    }
    catch(Exception e)
    {
    }
}
Back to top Copyright © 2017 Alachisoft