Registers the specified continuous query with the cache server. You can use this method multiple times in your application depending on its need to receive the notifications for a change in the dataset of your query. This method takes as argument an object of ContinuousQuery which has the query and the callbacks registered to it.
void RegisterCQ(ContinuousQuery query)
SQL-like query to be executed on cache.
Following example demonstrates how to register a Continuous Query with Item added, updated and removed callbacks.
string queryString = "SELECT MyApplication.Employee WHERE this.Salary > ?"; QueryCommand queryCommand = new QueryCommand(queryString); queryCommand.Parameters.Add("Salary", 50000); ContinuousQuery continuousQuery = new ContinuousQuery(queryCommand); continuousQuery.RegisterNotification(new QueryDataNotificationCallback(query_ItemAdded), EventType.ItemAdded, EventDataFilter.None); continuousQuery.RegisterNotification(new QueryDataNotificationCallback(query_ItemUpdated), EventType.ItemUpdated, EventDataFilter.DataWithMetadata); continuousQuery.RegisterNotification(new QueryDataNotificationCallback(query_ItemRemoved), EventType.ItemRemoved, EventDataFilter.None); cache.MessagingService.RegisterCQ(continuousQuery);