From ec22fcf8b552434161a87d88252c7ca985f06d3f Mon Sep 17 00:00:00 2001 From: Srikanth AD Date: Fri, 20 May 2016 18:17:20 -0400 Subject: [PATCH] Added "id" as third param to example function in README 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. } --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 91858a3..5d8b429 100644 --- a/README.md +++ b/README.md @@ -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() });