Method RegisterCQ
RegisterCQ(ContinuousQuery)
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.
Declaration
[Obsolete("This API is deprecated and will be removed in a future release. This feature is being retired and will not be continued in future versions.", false)]
void RegisterCQ(ContinuousQuery query)
Parameters
Type | Name | Description |
---|---|---|
Continuous |
query | SQL-like query to be executed on cache. |
Examples
The following example demonstrates how to register a continuous query with item added, updated and removed callbacks.
ICache cache = CacheManager.GetCache("demoCache");
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);