←back to thread

570 points davidgu | 2 comments | | HN request time: 0.432s | source
Show context
hombre_fatal ◴[] No.44525152[source]
Interesting. What if you just execute `NOTIFY` in its own connection outside of / after the transaction?
replies(4): >>44525332 #>>44525408 #>>44526003 #>>44528534 #
nick_ ◴[] No.44525408[source]
My thought as well. You could add notify commands to a temp table during the transaction, then run NOTIFY on each row in that temp table after the transaction commits successfully?
replies(2): >>44526402 #>>44526428 #
1. foota ◴[] No.44526402[source]
Wouldn't you need to then commit to remove the entries from the temp table?
replies(1): >>44526437 #
2. zbentley ◴[] No.44526437[source]
No, so long as the rows in there are transactionally guaranteed to be present or not, a sweeper script can handle removing failed “publishes” (notifys that didn’t delete their row) later.

This does sacrifice ordering and increases the risk of duplicates in the message stream, though.