-
-
Save gaybro8777/9dd8f188d15fe55c18436c8c7ba75805 to your computer and use it in GitHub Desktop.
PostgresToSNSWorker
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
| // 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