INNER CODE UNIT · Python
on_disconnect
sabuhish/fastapi-mqtt · fastapi_mqtt/fastmqtt.py:315
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")
return self.mqtt_handlers.on_disconnect(handler)
return disconnect_handler
def on_subscribe(self) -> Callable[..., Any]:
"""
Decorator method is used to obtain subscribed topics and properties.
"""
def subscribe_handler(handler: MQTTSubscriptionHandler) -> MQTTSubscriptionHandler:
self._logger.debug("on_subscribe handler accepted")