mpneuried / rsmq-worker

Helper to simply implement a worker around RSMQ ( Redis Simple Message Queue )
MIT License
117 stars 24 forks source link

.Send delay not delaying #1

Closed jsavko closed 9 years ago

jsavko commented 9 years ago

I've been experimenting with your message queue a bit.

I've been really impressed with it overall, but I can't get the worker.send delay to actually delay the message.

For my test I was attempting to send the received message after a 60 second delay.

 worker.on( "message", function( msg, next ){
    worker.send(msg, 60);`
    next()`
  });`

However the message is processed immediately. Am I missing something?

mpneuried commented 9 years ago

I will have a look at it and check it next week.

mpneuried commented 9 years ago

After a short look into the code I can provide a quick workaround. Just add an empty function to .send( msg, 60, function(){} ).

I will fix the argument dispatch next week, to make the callback in combination with the delay optional.

jsavko commented 9 years ago

Yep that does indeed fix the delay.

Thank you.