Heyas,
I’m creating a new component for an air conditioner. The aircon sends out status update messages over UDP periodically to signify the device needs updating.
I’m going to listen for these messages, I figure this is best done with asynch IO rather than consuming a thread just to sit there watching the socket.
There’s a couple of other parts where there is potential for async, in the initial discovery phase for the component, and when actually reading the status from the component (over http).
Is it best practice to do everything asynch?
I note that the netdisco module seems to do things synchronously, at least in the component that I looked at, but that doesn’t seem like best practice.
The other stuff like reading the current status, would that be best done as both a synch and and async version?
Thanks.