Closed 5amfung closed 8 years ago
just call .stop()
.
https://github.com/mpneuried/rsmq-worker#stop
That's what I thought too. Here's what I tried, but the script didn't stop. Am I missing something?
worker.start();
console.log('stop?');
worker.stop();
OK, now i can understand your need.
You want your script to end after the .stop()
, right?
That was not the intension of .stop()
.
So i added a .quit()
method with version 0.4.2
.
Here's an extract of the changed docs:
.stop()
Just stop the receive interval.
This will not cut the connection to rsmq/redis.
If you want you script to end call .quit()
Return
( Self ): The instance itself for chaining.
.quit()
Stop the worker and close the connection. After this it's no longer possible to reuse the worker-instance. It's just intended to kill all timers and connections so your script will end.
For a simple example like the following, what is the right way to exit the program? I tried
stop()
at the end and it didn't seem to do anything.