I am working on a website and am using Django for development. I have several devices that communicate with the site using MQTT, and I plan to use the paho-mqtt client. My problem is that for the paho-mqtt function, I have to call a function that loops forever while paho-mqtt continues to listen to messages. What is the best way for this loop to call and contain its own thread?
Is it possible to create a new thread or use something like celery?
source share