6 Replies
continuing-cyan•16mo ago
Yes!

continuing-cyan•16mo ago
I just tested the whole system.
So here are the steps 🧵
1. Create a Neon database.
Go to the SQL Editor and enter
continuing-cyan•16mo ago
You'd see this.

continuing-cyan•16mo 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.
deep-jade•16mo 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?
absent-sapphire•16mo 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