Heroku best practice watch with node.js

I am wondering what is the best way to configure the synchronization process on Heroku. My application was completely built in Node, and I planned to use node -schedule to specify my schedules.

My question is: should the synchronization process itself trigger events in my cron process and fire them within its own dedicated dyno? Heroku seems to indicate that you must use an employee to handle this. In this case, I wonder how I can get my watch process to tell the employee to start a specific procedure?

I read the Python method for this, and it seems like they just start the process inside the same speaker.

Thanks.

+5
source share
1 answer

Heroku says that synchronization processes should launch a new dynamic processor, which makes sense for scalability, since you can increase the frequency to 11 and split the clock process. https://devcenter.heroku.com/articles/scheduled-jobs-custom-clock-processes

I would use https://github.com/toots/node-heroku to start new processes in separate one-time speakers. But, if you want to have a pool of workers who handle synchronization processes, you will need a queue such as Resque or Kue. The synchronization process will trigger new tasks, and the workflow will delete them.

+2
source

Source: https://habr.com/ru/post/1493925/


All Articles