3 ms·
Thought this was an interesting approach, rather than the more well-known `LISTEN`/`NOTIFY` pub/sub mechanism!
by GordonS 4y ago
Thought this was an interesting approach, rather than the more well-known `LISTEN`/`NOTIFY` pub/sub mechanism!
- jerrysievert 4y agomuch more robust, with easier replay-ability.
- GordonS 4y agoWhich way do you mean, using WAL or Publish/Notify?
- MapleWalnut 4y agoWAL is reliable, but Publish/Notify isn't. You'll lose messages with Publish/Notify if you aren't listening for them.
- jerrysievert 4y agothis is exactly what I meant - WAL is your friend.
- thom 4y agoIf you just use notify to tell listeners “there is work in the queue to grab” can you still lose messages? I’ve always seen it implemented where workers have to go and claim items (transactionally), not just wait to be pushed them.
- SahAssar 4y agoNo, that way is safe. Just make sure that your workers also check for items in the queue when they start.
- cpursley 4y agoLISTEN/NOTIFY also has an 8000 character limitation.
- GordonS 4y agoThe way I've ways seen LISTEN/NOTIFY used is just to send a "hey, there are items available in the queue!" signal to consumers. I take your point though, that WAL is less limiting in this regard.