From 8a7aa40b1f384d82d7c84e27ac54c86a48ba4dab Mon Sep 17 00:00:00 2001 From: Matt Link Date: Tue, 30 Jul 2024 23:24:57 -0500 Subject: [PATCH] update ws example --- examples/basic_ws.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/basic_ws.py b/examples/basic_ws.py index 4efdc9df..bc4c49ec 100644 --- a/examples/basic_ws.py +++ b/examples/basic_ws.py @@ -24,4 +24,8 @@ async def ws(msg:str, send): await sleep(2) return Div('Goodbye ' + msg, id=nid), mk_inp() +@app.ws('/stream', conn=on_connect, disconn=on_disconnect) +async def ws_stream(ws, data): + print(data) + serve()