Files
loon-backend/loon/mqtt/handlers/server.py
T
ciomek 279b2a7e90
Build and Push Docker Image / build-and-push (push) Successful in 18s
Initial commit
2026-08-16 11:41:07 +02:00

19 lines
422 B
Python

import json
from loon.web.users.state import user_threads
async def server_handler(client, userdata, msg):
if msg.topic != "loon/server/info":
return
try:
data = json.loads(msg.payload.decode())
except json.JSONDecodeError:
return
envelope = json.dumps({"topic": "server/info", "payload": data})
for queue in list(user_threads.values()):
await queue.put(envelope)