lib/pq currently has a dedicated set of functionality for subscribing to
LISTEN/NOTIFY messages, but you have to use it on a separate connection.
This commit adds a simple way to register a handler for notifications
that is on an ordinary database connection. This is useful if a user
wants to LISTEN to a channel on the same connection as their ordinary
database connection.
lib/pq currently has a dedicated set of functionality for subscribing to LISTEN/NOTIFY messages, but you have to use it on a separate connection.
This commit adds a simple way to register a handler for notifications that is on an ordinary database connection. This is useful if a user wants to LISTEN to a channel on the same connection as their ordinary database connection.