Skip to content

Add handler for LISTEN/NOTIFY notifications - #965

Merged
madelynnblue merged 1 commit into
lib:masterfrom
jordanlewis:notifications
May 3, 2020
Merged

Add handler for LISTEN/NOTIFY notifications#965
madelynnblue merged 1 commit into
lib:masterfrom
jordanlewis:notifications

Conversation

@jordanlewis

Copy link
Copy Markdown
Contributor

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.
@jordanlewis

Copy link
Copy Markdown
Contributor Author

@mjibson PTAL. This is for adding messages to cockroach sql when a connection receives a LISTEN/NOTIFY message. See cockroachdb/cockroach#48308.

@madelynnblue
madelynnblue merged commit 6a6cbca into lib:master May 3, 2020
@jordanlewis
jordanlewis deleted the notifications branch May 3, 2020 16:13
@jordanlewis

Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants