Listen for all channel notifications

Started by Trey Boudreaualmost 2 years ago2 messageshackers

Thread notes

1 note#feature#moderate#enhancement
hackorum-bot#feature#moderate#enhancement
hackorum-bot
1 day ago

@global #feature #moderate #enhancement

#feature#moderate#enhancement
Jump to latest
#1Trey Boudreau
trey@treysoft.com

Based on [1]/messages/by-id/737106.1734732462@sss.pgh.pa.us, please find attached an implementation for listening
for notifications on all channels. The first two chunks lay some
groundwork and do not change the current LISTEN behavior, except
to improve performance of managing large numbers of channels.

v1-0001-Make-simplehash-more-flexible.patch makes working with
char pointer keys possible.

v1-0002-Improve-LISTEN-NOTIFY-UNLISTEN-performance.patch replaces
the current List implementation with a simplehash.h-based table.

v1-0003-WIP-Allow-LISTENing-for-all-channels.patch has the real meat
but needs further work, as the results from pg_listening_channels()
provides no clue that, after 'LISTEN *', the results list exceptions
rather than notifiable channels.

[1]: /messages/by-id/737106.1734732462@sss.pgh.pa.us

-- Trey



Attachments:

v1-0001-Make-simplehash-more-flexible.patchapplication/octet-stream; name=v1-0001-Make-simplehash-more-flexible.patch; x-unix-mode=0664Download+38-3
v1-0002-Improve-LISTEN-NOTIFY-UNLISTEN-performance.patchapplication/octet-stream; name=v1-0002-Improve-LISTEN-NOTIFY-UNLISTEN-performance.patch; x-unix-mode=0664Download+81-46
v1-0003-WIP-Allow-LISTENing-for-all-channels.patchapplication/octet-stream; name=v1-0003-WIP-Allow-LISTENing-for-all-channels.patch; x-unix-mode=0664Download+189-30
#2Trey Boudreau
trey@treysoft.com
In reply to: Trey Boudreau (#1)
Re: Listen for all channel notifications

On 2024-12-24 13:09, Trey Boudreau wrote:

Based on [1], please find attached an implementation for listening
for notifications on all channels. The first two chunks lay some
groundwork and do not change the current LISTEN behavior, except
to improve performance of managing large numbers of channels.

Trying another email client to see if the patches show up.

Attachments:

t50812_2
v1-0001-Make-simplehash-more-flexible.patchtext/x-diff; name=v1-0001-Make-simplehash-more-flexible.patchDownload+38-3
v1-0003-WIP-Allow-LISTENing-for-all-channels.patchtext/x-diff; name=v1-0003-WIP-Allow-LISTENing-for-all-channels.patchDownload+189-30
v1-0002-Improve-LISTEN-NOTIFY-UNLISTEN-performance.patchtext/x-diff; name=v1-0002-Improve-LISTEN-NOTIFY-UNLISTEN-performance.patchDownload+81-46