Skip to content

Commit

Permalink
Added "id" as third param to example function in README
Browse files Browse the repository at this point in the history
Key point for this commit is that "id" of the message can be leveraged as the third parameter for worker.on function. 
worker.on( "message", function( msg, next, id ){ 
// Example
use the "id" to delete the message once processed.
}
  • Loading branch information
Srikanth-AD committed May 20, 2016
1 parent 190d902 commit ec22fcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Helper to simply implement a worker [RSMQ ( Redis Simple Message Queue )](https:
var RSMQWorker = require( "rsmq-worker" );
var worker = new RSMQWorker( "myqueue" );

worker.on( "message", function( msg, next ){
worker.on( "message", function( msg, next, id ){
// process your message
console.log("Message id : " + id);
console.log(msg);
next()
});

Expand Down

0 comments on commit ec22fcf

Please sign in to comment.