I’ll give it a try
The protocol is CoAP, which uses a TLS encrypted UDP session internally. Because it is less trivial to implement this in LUA, I use a custom lua library (luacoap). For some logic this uses async I/O, but for some it is synchronous.
One way to synchronize the Tradfri device representation on the UI is to use polling. This polling is done on a fixed interval that is configurable from the plugin and set to 30 seconds by default. The poll function will iterate over all Tradfri devices and individually queries the status, so this scales linearly with the amount of devices.
The polling is triggered via luup.call_delay
. Alternatively I could implement this via a job, but that does not seem to bring any advantages.
On Vera - at least according documentation - each luup.call_delay runs in its own thread.
When I read the openLuup scheduler code it looks like a long running timer callback
(or job) blocks the scheduler.
Is the conclusion correct that on this point openLuup behaves different than Luup?
If so, can I run a timed operation in openLuup that does not block the main execution luup?