I think the best way to do this, is what you are thinking, to have a background thread working asynchronously to get active notification instances from the server and display the information on your application's UI thread (which I assume is like a Windows Form application).
You can set up callback within your application to update information after you get notification instances. Refer to this article on MSDN. Event though the article assumes you are using to get data from a Web Service, the idea can be applicable in this case.
I think the best way to get active notifications instances is using the ANNotificationList.GetActiveInstances method. You can choose which notifications you want to include in the ANNotificationList object. Here's a code snippet for this:
// searching for configured notifications from an AF database (afdb)
AFNamedCollectionList<AFNotification> notifications = AFNotification.FindNotifications(afdb, "*", AFSearchField.Name, AFSortField.Name, AFSortOrder.Ascending, 1000);
// instantiate ANNotificationList object
ANNotificationList notiList = new ANNotificationList(notifications);
// get active instances from the list of notifications
List<ANNotificationInstances> instances = notiList.GetActiveInstances();
Thank you Han.
As I see, I will implement it using a new background thread.
There is also the InstanceEvent event on ANNotificationList that will fire when a notification in the list is creates a new instance or ends the current instance. The ContactEvent event will fire when there are sends, resends, acknowledgements, and comments added, among other things.
It is excellent.
I have a thread to read a bunch of PI values and do not want to add another thread for notifications.
I will try develop it this way.
Thank you Mike