Created
March 9, 2015 15:40
-
-
Save dustinsmith1024/85524b4e765f6c2b919f to your computer and use it in GitHub Desktop.
PG Notify Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pg = require ('pg'); | |
var pgConString = "postgres://localhost/xxxx" | |
pg.connect(pgConString, function(err, client) { | |
if(err) { | |
console.log(err); | |
} | |
client.on('notification', function(msg) { | |
console.log(msg); | |
}); | |
var query = client.query("LISTEN watchers"); | |
var query2 = client.query("LISTEN model_watchers"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment