Permalink
Browse files

Better debug

  • Loading branch information...
1 parent 387b5f2 commit ae96436a0567a785d6ebd162851585f64eaf0c09 @dmongeau dmongeau committed Oct 16, 2015
Showing with 9 additions and 6 deletions.
  1. +8 −5 lib/processor.js
  2. +1 −1 package.json
View
@@ -98,6 +98,8 @@ TwitterProcessor.prototype._startStream = function() {
var self = this;
+ debug('Starting stream...', this.options.filter);
+
this.stream = this.twitter.stream('statuses/filter', this.options.filter);
this.stream.on('tweet', function (tweet)
{
@@ -134,14 +136,13 @@ TwitterProcessor.prototype._startStream = function() {
};
//Add tweet
-TwitterProcessor.prototype.addTweet = function(tweet) {
-
+TwitterProcessor.prototype.addTweet = function(tweet)
+{
//Add tweet to queue
this.queue.add(tweet);
//Emit add event
this.emit('add',tweet);
-
};
//Start
@@ -182,7 +183,8 @@ TwitterProcessor.prototype.stop = function() {
this.stream.stop();
}
- if(this.queue) {
+ if(this.queue)
+ {
this.queue.stop();
}
@@ -194,7 +196,8 @@ TwitterProcessor.prototype.process = function(job,done) {
if(!this.processor) done();
- if(this.processor) {
+ if(this.processor)
+ {
this.processor(job.data,function() {
done();
});
View
@@ -11,7 +11,7 @@
"contributors": [
"David Mongeau-Petitpas <dmp@atelierfolklore.ca>"
],
- "version": "1.0.4",
+ "version": "1.0.5",
"dependencies": {
"debug": "^2.2.0",
"queueleuleu": "0.x",

0 comments on commit ae96436

Please sign in to comment.