INNER CODE UNIT · Python

on_connect

sabuhish/fastapi-mqtt · fastapi_mqtt/fastmqtt.py:293

    def on_connect(self) -> Callable[..., Any]:
        """
        Decorator method used to handle the connection to MQTT.
        """

        def connect_handler(handler: MQTTConnectionHandler) -> MQTTConnectionHandler:
            self._logger.debug("handler accepted")
            return self.mqtt_handlers.on_connect(handler)

        return connect_handler

    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")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…