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.
Hi Deema, sorry for the delay in getting back to you but you can have a look into this example from Skyline's GitHub https://github.com/SkylineCommunications/SLC-C-Example_Polling-Manager/tree/1.0.0.X
Then you can adjust the logic in https://github.com/SkylineCommunications/SLC-C-Example_Polling-Manager/blob/1.0.0.X/QAction_1/PollingManager/Pollable.cs#L14 to do something like a CheckTrigger to add the polling group on the queue.
CheckTrigger documentation https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Scripting.SLProtocol.CheckTrigger.html
Hi João,
Is there a valid example or existing protocol that has implemented dynamic HTTP polling using a timer that I could look into?