I need to create a python script that will basically subscribe to an external services provider. Afterwards, the values of these services have to be mapped to certain tags already created in advance. What is the best way of setting this subscription script in the system?. This script will collect the updated values so basically it needs to be always active and running in the background in somehow. Ideally, this script would update the tag values within the same code, therefore it makes no sense to me to set it to a tag change level.
It should retrieve data (This I know already how to do it), and map the new values to certain tags and if possible in the same script. Any hint to do this and have the script always running?
I setup a file watcher background thread with system.util.invokeAsynchronous() and @pturmel 's system.util.persistent(). I invoke it in a gateway startup script, which updates another dictionary variable named status. I have a tag that polls the status, if it wasn’t manually closed and is not running I automatically restart it with tag change event.