Skip to content

Instantly share code, notes, and snippets.

@ingoogni
ingoogni / hbmqttcherrypy.py
Last active March 6, 2019 06:16
Cherrypy MQTT HBMQTT plugin
#https://stackoverflow.com/questions/26270681/can-an-asyncio-event-loop-run-in-the-background-without-suspending-the-python-in
import asyncio
import threading
import cherrypy
from cherrypy.process import plugins
from hbmqtt.client import MQTTClient, ClientException
from hbmqtt.mqtt.constants import QOS_1, QOS_2