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

fetch jobs from jobqueue on rethinkdb reconnect #86

Open mohit5540 opened 5 years ago

mohit5540 commented 5 years ago

@grantcarthew @zllovesuki

With reference to #85, #72 we are able to reconnect rethinkdb through 'pingInterval' option. Now the problem is, even though rethinkdb gets connected, JobQueue does not start taking jobs again. script needs to restart again.

@grantcarthew I know you are working on other project at the moment, but some help in this regard will be highly appreciated.

Thanks

grantcarthew commented 5 years ago

Hi again @mohit5540,

In the best possible way I would like you to be aware of this blog article: I thought I understood open source, I was wrong

With that in mind I am very happy to add maintainers (collaborators) to the project to prevent the project being fragmented.

I believe most of the functionality you are after is with the change-feed-reconnect that is discussed in #77. This will fix the re-connection issues. Once re-connect is working then a simple call to queueProcess.restart will restart processing.

I have created a PR #87 that will add rethinkdb-changefeed-reconnect. Either work with this or create your own. If you want to keep the work to a minimum you could simply expose queueProcess.restart as a public API method so you can call it yourself.

You will need to call queueProcess.restart on reconnect. If the rethinkdb-changefeed-reconnect doesn't have a related event then an internal connection status poll or something like that would do the job. That's were you come in 👍 .

Feel free to keep asking questions. Happy to help were I can.

grantcarthew commented 5 years ago

I just had a look and the Queue.resume public API call could work if you want to just restart processing. A Queue.restart would be a good addition to the package though.

grantcarthew commented 5 years ago

ping @mohit5540