INNER CODE UNIT · Python
__set_connetion_config
sabuhish/fastapi-mqtt · fastapi_mqtt/fastmqtt.py:141
async def __set_connetion_config(self) -> None:
"""
The connected MQTT clients will always try to reconnect in case of lost connections.
The number of reconnect attempts is unlimited.
For changing this behavior, set reconnect_retries and reconnect_delay with its values.
For more info: https://github.com/wialon/gmqtt#reconnects
"""
self.client.set_config(
{
"reconnect_retries": self.config.reconnect_retries,
"reconnect_delay": self.config.reconnect_delay,
}
)
def __on_connect(self, client: MQTTClient, flags: int, rc: int, properties: Any) -> None:
"""
Generic on connecting handler, it would call user handler if defined.
Will perform subscription for given topics.