tagreader-python
tagreader-python copied to clipboard
Function connect and property isconnected/isavailable
Make it possible to verify that provided is available for connection prior to / independent of actually attempting query.
Our use case can then fail nicely before reading a lot of config files to get the tags.
Are you suggesting to set the property isconnected when connect() succeeds? isconnected == True will not be able to account for a broken connection after calling connect(), so I am wary to include such a property.
I can look into creating a method to check connectivity to server (e.g. by performing a basic query that should work on all servers). You can call that as often as you want and keep the status in your own application. Or simply attach it to the client yourself:
client.isconnected = client.connect()
If you have suggestions for simple tests queries for one or more of the four IMS handlers used by Tagreader, please post them here.