Hi Everyone,
We are currently working on an ad hoc data source that supports live updates. Typically, subscriptions to elements are established before calling the GetNextPage method. However, in this case, we would like to perform the subscription within the GetNextPage method, as the elements or tables are not accessible until that point.
To achieve this, we plan to iterate through a set of events, identify the validated ones, and use the necessary data to establish subscriptions.
Is it feasible to handle subscriptions within the GetNextPage method? If so, what would be the expected load, considering we may have numerous events, and each event requires subscriptions to two tables?
Hi Carlos,
Since the GetNextPage method might be called multiple times to retrieve several pages, I think it's not recommended to subscribe and unsubscribe in that method.
I also don't immediately see which information would be missing in the OnStartUpdates method compared to the GetNextPage method. Maybe you'll need to store some information in a field of the class that represents the ad-hoc data source. An instance of that class is created for every query, so data isn't shared between multiple sessions. That data can then be used to build the row objects in the GetNextPage method. Also don't forget to unsubscribe in the OnStopUpdates method.
Hi Tom,
It makes sense, I will give it a try, but that definitely should work for my use case.
Thank you!