Skip to content

Commit

Permalink
explain event emitter usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Oct 2, 2014
1 parent 68848aa commit 71572bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/pubsub/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ var util = require('../common/util.js');
*
* - {@linkcode module:pubsub/topic#subscription}
*
* A subscription won't begin pulling for messages until you register an event
* listener. See below for an example.
* All Subscription objects are instances of an
* [EventEmitter]{@link http://nodejs.org/api/events.html}. The subscription
* will pull for messages automatically as long as there is at least one
* listener assigned for the `message` event.
*
* @alias pubsub/subscription
* @constructor
Expand All @@ -79,7 +81,7 @@ var util = require('../common/util.js');
* // From {@linkcode module:pubsub/topic#subscribe}:
* //-
* var topic = pubsub.topic('my-existing-topic');
* topic.subscribe('new-subscrpition', function(err, subscription) {
* topic.subscribe('new-subscription', function(err, subscription) {
* // `subscription` is a Subscription object.
* });
*
Expand Down

0 comments on commit 71572bb

Please sign in to comment.