porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.42k stars 271 forks source link

Listen multiple channels on one connection #725

Open pauldraper opened 11 months ago

pauldraper commented 11 months ago

If listening for multiple channels, it is wasteful to use a separate connection for each one.

I understand this is related to the choice to reuse listeners for a single channel.

While there is advantages to that in some case, in other cases (many channels), it is advantageous to reuse a connection for multiple channels.