Skip to content

Commit

Permalink
Processor accept a function instead of an object with a process method
Browse files Browse the repository at this point in the history
  • Loading branch information
dmongeau committed Dec 4, 2012
1 parent db5d3bf commit 1a663d1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ var TwitterProcessing = function(options) {
//Options
this.options = utils.merge({
'debug' : false,
'processor' : null,
'processor' : function(job,done){
done();
},
'redis' : {
'host' : '127.0.0.1',
'port' : 6379
Expand Down Expand Up @@ -244,9 +246,11 @@ TwitterProcessing.prototype.process = function(job,done) {

if(!this.processor) done();

this.processor.process(job,function() {
job.save(done);
});
if(this.processor) {
this.processor(job,function() {
job.save(done);
});
}

return;

Expand Down

0 comments on commit 1a663d1

Please sign in to comment.