This commit is contained in:
commit
279b2a7e90
49 files changed
+2664
No files matched your search
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
Reference in new issue
Block a user