INNER CODE UNIT · Python
on_message
sabuhish/fastapi-mqtt · fastapi_mqtt/fastmqtt.py:304
def on_message(self) -> Callable[..., Any]:
"""
The decorator method is used to subscribe to messages from all topics.
"""
def message_handler(handler: MQTTMessageHandler) -> MQTTMessageHandler:
self._logger.debug("on_message handler accepted")
return self.mqtt_handlers.on_message(handler)
return message_handler
def on_disconnect(self) -> Callable[..., Any]:
"""
The Decorator method used wrap disconnect callback.
"""
def disconnect_handler(handler: MQTTDisconnectHandler) -> MQTTDisconnectHandler:
self._logger.debug("on_disconnect handler accepted")