kopia lustrzana https://github.com/cirospaciari/socketify.py
update text in websockets/falcon_server.py
rodzic
eb91d7c90d
commit
5d6d61a15e
|
@ -6,14 +6,11 @@ clients = set([])
|
||||||
remaining_clients = 16
|
remaining_clients = 16
|
||||||
|
|
||||||
async def broadcast(message):
|
async def broadcast(message):
|
||||||
|
# some clients got disconnected if we tried to to all async :/
|
||||||
# tasks = [ws.send_text(message) for ws in client]
|
# tasks = [ws.send_text(message) for ws in client]
|
||||||
# return await asyncio.wait(tasks, return_when=ALL_COMPLETED)
|
# return await asyncio.wait(tasks, return_when=ALL_COMPLETED)
|
||||||
for ws in clients:
|
for ws in clients:
|
||||||
await ws.send_text(message)
|
await ws.send_text(message)
|
||||||
# # for ws in clients:
|
|
||||||
# # tasks.append(ws.send_text(message))
|
|
||||||
# await asyncio.wait(tasks, return_when=ALL_COMPLETED)
|
|
||||||
|
|
||||||
|
|
||||||
class SomeResource:
|
class SomeResource:
|
||||||
|
|
Ładowanie…
Reference in New Issue