Created
March 4, 2017 20:39
-
-
Save FGRibreau/a872b20b6a689cb6b9731117d8bdf27e to your computer and use it in GitHub Desktop.
PostgresToSNSWorker
This file contains 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
// Basic PostgresToSNSWorker worker | |
const pg = require ('pg'); | |
const pgConString = process.env.POSTGRESQL_CONNECTIONSTRING; | |
pg.connect(pgConString, function(err, client) { | |
if(err) { | |
console.log(err); | |
} | |
client.on('notification', function(msg) { | |
// @todo send message to AWS SNS | |
console.log(msg); | |
}); | |
const query = client.query("LISTEN watchers"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment