Skip to content

Wirehive/pgwebsocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgwebsocket

from pgwebsocket import PgWebsocket

app = PgWebsocket(
    "postgresql:https://"
)

@app.on_connect
async def on_connect(ctx):
    """"""
    ctx.subscribed = []
    await ctx.execute("LISTEN all;")

@app.on_disconnect
async def on_disconnect(ctx):
    """"""
    await ctx.execute("UNLISTEN all;")

if __name__ == '__main__':
    app.run()