kopia lustrzana https://github.com/cirospaciari/socketify.py
remove dead code from test
rodzic
239302062f
commit
9586366539
|
@ -3,13 +3,6 @@ from socketify import ASGI
|
||||||
clients = set([])
|
clients = set([])
|
||||||
remaining_clients = 16
|
remaining_clients = 16
|
||||||
|
|
||||||
async def broadcast(message):
|
|
||||||
for send in clients:
|
|
||||||
await send({
|
|
||||||
'type': 'websocket.send',
|
|
||||||
'text': message
|
|
||||||
})
|
|
||||||
|
|
||||||
async def app(scope, receive, send):
|
async def app(scope, receive, send):
|
||||||
global remaining_clients
|
global remaining_clients
|
||||||
|
|
||||||
|
@ -46,7 +39,6 @@ async def app(scope, receive, send):
|
||||||
'topic':"all"
|
'topic':"all"
|
||||||
})
|
})
|
||||||
if remaining_clients == 0:
|
if remaining_clients == 0:
|
||||||
# await broadcast("ready")
|
|
||||||
await send({
|
await send({
|
||||||
'type': 'websocket.publish',
|
'type': 'websocket.publish',
|
||||||
'topic': "all",
|
'topic': "all",
|
||||||
|
@ -65,7 +57,6 @@ async def app(scope, receive, send):
|
||||||
print("remaining_clients", remaining_clients)
|
print("remaining_clients", remaining_clients)
|
||||||
break
|
break
|
||||||
|
|
||||||
# await broadcast(scope.get('text', ''))
|
|
||||||
await send({
|
await send({
|
||||||
'type': 'websocket.publish',
|
'type': 'websocket.publish',
|
||||||
'topic': "all",
|
'topic': "all",
|
||||||
|
|
Ładowanie…
Reference in New Issue