grantcarthew / node-rethinkdb-job-queue

A persistent job or task queue backed by RethinkDB.
https://github.com/grantcarthew/node-rethinkdb-job-queue/wiki
MIT License
157 stars 16 forks source link

Detach queue from database without processing all jobs before #57

Closed ebekebe closed 7 years ago

ebekebe commented 7 years ago

I have the following problem: I have several workers that fetch jobs from the database and process them. There are always new jobs coming in, so I cannot pause the queue, because there will always be new jobs and the pause promise will not resolve. I want to shut down the worker gracefully. Is there a way to do this?

grantcarthew commented 7 years ago

Yes, Queue.stop will do this for you. It will only stop the local Queue object, not the whole queue.

ebekebe commented 7 years ago

Thanks for making this clear.