Bear with me as this is all new to me and learning by trial and error.
I’m querying a remote api using httputil for status updates.
I cannot poll each channel idividually due to rate limits, and I cannot poll all channels at once as the payload is too big for the server to respond.
So I’ve settled on polling each thing (about 10 channels).
The trouble is, if I have say 20 things then the system overloads as I believe it is using a single thread.
What is the best way to handle this?
I’ve done a bit of reading and I’ve implemented new thread(new runnable).start and it’s decreased the time taken to issue/refresh statuses. But I feel this is bad design.
Any help with examples would be most appreciated.
Remote app —> openhab works fine
Device operation —> openhab works fine
Openhab —> remote device suffers delays and race condition, so I believe I need to interrupt the thread/http whilst it sends the command
Example of new thread I have implemented:
Last version on there