mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-07-29 15:29:14 +02:00
show how many users
This commit is contained in:
@@ -117,6 +117,7 @@ def websocket_server_process(shared_data: dict, imc_q: multiprocessing.Queue, ws
|
|||||||
|
|
||||||
async def handler_wrapper(websocket: ServerConnection):
|
async def handler_wrapper(websocket: ServerConnection):
|
||||||
clients.add(websocket)
|
clients.add(websocket)
|
||||||
|
await asyncio.get_event_loop().run_in_executor(None, ws_q.put, {"data": len(clients), "event": "users"})
|
||||||
try: await ws_handler(websocket, shared_data, imc_q, ws_q)
|
try: await ws_handler(websocket, shared_data, imc_q, ws_q)
|
||||||
finally:
|
finally:
|
||||||
await websocket.close(1001, "")
|
await websocket.close(1001, "")
|
||||||
|
|||||||
Reference in New Issue
Block a user