Archived
ugly ws controller
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from websockets.server import WebSocketServerProtocol
|
||||
|
||||
|
||||
class Client:
|
||||
websocket: WebSocketServerProtocol
|
||||
|
||||
def __init__(self, websocket: WebSocketServerProtocol):
|
||||
self.websocket = websocket
|
||||
|
||||
async def listen(self):
|
||||
async for message in self.websocket:
|
||||
await self.on_message(message)
|
||||
|
||||
async def on_message(self, message):
|
||||
print(message)
|
||||
Reference in New Issue
Block a user