I'm using an ESP8266 ESP-12E board to create an MQTT endpoint for my Home Assistant setup. I'm using the AsyncMqttClient library, which uses ESPAsyncTCP to send and receive MQTT messages over WiFi.
I've set this up using code from the examples that come with the libraries and it is working well.
My question is about how it is working.
The Wifi and MqttClient callbacks are set up in the Setup function of my sketch and Wifi connect is called. The Loop function is empty. I can add a delay(10000) to the loop function, and the MQTT message handler stays responsive.
It seems it must be using a software interrupt to service the TCP requests outside of Loop(), but I'm not good enough with C/C++ to figure out how it works from the source.
How is this kind of async programming usually done since it does not seem to use a hardware interrupt or rely on a function being called inside Loop() ?
Thanks for any insight.