Stream kinda working

This commit is contained in:
Cyber MacGeddon 2025-05-02 16:19:43 +01:00
parent bba84dbe39
commit 3d307cfb89
5 changed files with 87 additions and 30 deletions

View file

@ -26,10 +26,13 @@ class SocketEndpoint:
async def listener(self, ws, dispatcher, running):
print("In listener...!!!!!!!!!!!!!!!!!!!!")
async for msg in ws:
# On error, finish
print ("mt:", msg.type)
if msg.type == WSMsgType.TEXT:
print("YER!!!!!")
await dispatcher.receive(msg)
continue
elif msg.type == WSMsgType.BINARY:
@ -63,7 +66,9 @@ class SocketEndpoint:
running = Running()
print("Create...")
dispatcher = await self.dispatcher(ws, running, request)
dispatcher = await self.dispatcher(
ws, running, request.match_info
)
print("Create worker...")
worker_task = tg.create_task(