We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d34423 commit d50a37dCopy full SHA for d50a37d
examples/mqtt/pub_sub.py
@@ -12,7 +12,10 @@ async def subscriber(client: enapter.mqtt.Client) -> None:
12
13
async def publisher(client: enapter.mqtt.Client) -> None:
14
while True:
15
- await client.publish(topic="/time", payload=str(time.time()))
+ try:
16
+ await client.publish(topic="/time", payload=str(time.time()))
17
+ except enapter.mqtt.Error as e:
18
+ print("error", e)
19
await asyncio.sleep(1)
20
21
0 commit comments