We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b3cd51 commit 1994196Copy full SHA for 1994196
postgresql2websocket.py
@@ -22,7 +22,9 @@ async def websocket_handler(request):
22
await connection.add_listener(channel, callback_websocket(ws))
23
try:
24
async for msg in ws:
25
- pass
+ async with connection.transaction():
26
+ async for record in connection.cursor(msg.data):
27
+ asyncio.ensure_future(ws.send_json(dict(record)))
28
finally:
29
request.app['websockets'].remove(ws)
30
return ws
0 commit comments