weyoss / redis-smq

A simple high-performance Redis message queue for Node.js.
MIT License
588 stars 64 forks source link

How to stop a producer without finish the process? #3

Closed dionnyprensa closed 6 years ago

dionnyprensa commented 6 years ago

Need to stop the producer without execute "process.exit(0);"

weyoss commented 6 years ago

Version 1.0.7 is out. You can use producer.shutdown() method to gracefully shutdown the producer instance and disconnect from Redis. It is worth to note that from that point (after the method has been called) the instance can no longer produce messages. A new instance should to be initialized when needed. This method has been introduced with the aim of doing some kind of garbage cleaning and system resources releasing when needed, e.g. class destruction.

weyoss commented 6 years ago

Closing as resolved.