6 Replies
genetic-orange•2y ago
Yes!

genetic-orange•2y ago
I just tested the whole system.
So here are the steps 🧵
1. Create a Neon database.
Go to the SQL Editor and enter
genetic-orange•2y ago
You'd see this.

genetic-orange•2y ago
2. Create a listener script:
and run this via
3. Create a send notification script:
and run this via
and you should see as in my first screenshot.
ambitious-aqua•2y ago
Oh cool! I’m using rust and sqlx, I think it has support as well thanks you! Do you think this would be a suitable replacement for using websockets? Like what is an ideal use case for this?
xenogeneic-maroon•2y ago
Oh cool! I’m using rust and sqlx, I think it has support as well thanks you!Yes, absolutely
Like what is an ideal use case for this?Listen/Notify is great for work queue use cases. You can insert an entry into a table and notify another postgres session that this entry is available. That session could then claim this row as a 'inflight work'' Someone else designed this implementation. I gave some more details in the reply to this message https://discord.com/channels/1176467419317940276/1178738361276563546/1241660433539141722