Hi everyone,
In an HTTP-based protocol, how can I implement dynamic polling for specific groups?
Currently, polling is handled by a timer, but I’d like to allow users to dynamically adjust polling intervals from the UI — for example, using write parameters to control how often each group is polled.
If anyone has suggestions, best practices, example implementations, or a tutorial for this approach, it would be greatly appreciated.
Thanks in advance,
Hi Deema,
You should be able to achieve your goal by implementing a table similar to the one in Alberto's answer to another question.
Besides the table, you then need an extra timer that will have a frequency in line with what you want to be the smallest division your users should be able to configure (e.g. 1 1-second timer if you should be able to configure down to the second, or 1-minute timer if your users will only configure in multiples of minutes).
You can then use a QAction that gets triggered every cycle of the timer and checks which groups it should add to execution via Method CheckTrigger | DataMiner Docs.
Alternatively, you could use a combination of internal XML parameters, triggers, actions, and groups to decrement a counter stored in the internal parameter with every timer cycle. Once it reaches zero, you would add the desired polling group to the execution queue.