Comparing version 0.1.0 to 0.1.1
@@ -122,3 +122,3 @@ /*jslint node: true */ | ||
this.retry.end(); | ||
this.removeAllListeners(channel); | ||
this.removeAllListeners(); | ||
this.channels = []; | ||
@@ -125,0 +125,0 @@ }; |
{ | ||
"name": "pg-pubsub", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A Publish/Subscribe implementation on top of PostgreSQL NOTIFY/LISTEN", | ||
"url": "http://github.com/voxpelli/node-pg-pubsub", | ||
"homepage": "http://github.com/voxpelli/node-pg-pubsub", | ||
"repository": { | ||
@@ -17,4 +17,4 @@ "type": "git", | ||
"dependencies": { | ||
"lodash": "^2.4.1", | ||
"promise": "^5.0.0", | ||
"lodash": "^3.0.0", | ||
"promise": "^6.0.0", | ||
"promised-retry": "^0.1.0" | ||
@@ -21,0 +21,0 @@ }, |
@@ -11,2 +11,6 @@ # PG PubSub | ||
## Requirements | ||
Either the `pg` or the `pg.js` npm package has to be installed. | ||
## Usage | ||
@@ -22,6 +26,9 @@ | ||
}); | ||
``` | ||
Advanced: | ||
Sending `NOTIFY channelName, '{"hello":"world"}'` to PostgreSQL will trigger the above listener with the parsed JSON in `channelPayload` . | ||
More advanced variant: | ||
```javascript | ||
@@ -42,7 +49,11 @@ var pubsubInstance = new PGPubsub('postgres://username@localhost/tablename'); | ||
* **removeChannel(channelName[, eventListener])** – either removes all event listeners and stops listeneing on the channel or removes the specified event listener and stops listening on the channel if that was the last listener attached. | ||
* **close** – closes down the database connection and removes all listeners | ||
* **close** – closes down the database connection and removes all listeners. Useful for graceful shutdowns. | ||
* All [EventEmitter methods](http://nodejs.org/api/events.html#events_class_events_eventemitter) are inherited from `EventEmitter` | ||
## Description | ||
Creating a `PGPubsub` instance will not do much up front. It will prepare itself to start a Postgres connection once the first channel is added and then it will keep a connection open until its shut down, reconnecting it if it gets lost, so that it can constantly listen for new notifications. | ||
## Lint / Test | ||
`npm test` or to watch, install `grunt-cli` then do `grunt watch` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5987
6
1
57
+ Addedlodash@3.10.1(transitive)
+ Addedpromise@6.1.0(transitive)
Updatedlodash@^3.0.0
Updatedpromise@^6.0.0