Need help on getting notifcation message from postgresql

2021-02-25 Thread geohuz
@enthus1ast thanks for the reply! I tried hard to read documentation on nim asyncdispatch and related documentation on postgresql, and come up with the following solution, it did work, but I'm not a experienced dev on system programming, I really need you help to review it: import

Need help on getting notifcation message from postgresql

2021-02-25 Thread enthus1ast
i've done it like this, i was not able to get the notice receiver or the notice processor callback to work, but polling worked for my use case to i tried not so hard. import db_postgres import postgres let db = open("", "", "", "") import os db.exec(sql("LISTEN

Need help on getting notifcation message from postgresql

2021-02-24 Thread treeform
Sorry, I don't think I implemented channels with LISTEN.

Need help on getting notifcation message from postgresql

2021-02-23 Thread geohuz
@treeform thanks for your reply! I've tried the pg, but I can't wrap my head around using it for my case. My case is just running a pg client (forever), subscribe (listen) to a channel named "testChannel", and echo every notification payload sent through the channel. I think something simple as,

Need help on getting notifcation message from postgresql

2021-02-23 Thread treeform
Have you tried pg?

Need help on getting notifcation message from postgresql

2021-02-23 Thread geohuz
I've tried asyncpg but getting "Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]", can't find other lib with high level support for this feature, can somebody help me?