0

can't we create different thread in node.js ?? I want to pool database for every 1 sec in different thread and run main program in one thread. I used setInterval function but, it seems, it is blocked or not acting as expected. I am new at node,Nice reply would be nice.

Suresh Mainali
  • 232
  • 1
  • 9
  • 1
    possible duplicate of [How to create threads in nodejs](http://stackoverflow.com/questions/18613023/how-to-create-threads-in-nodejs) – Biffen Nov 27 '14 at 14:25

2 Answers2

0

This question has been already answered here. But to resume, you cannot create Thread (except if you use add-on) but you can run new NodeJs process.

Community
  • 1
  • 1
Nogebour
  • 141
  • 7
0

setInterval won't work in this case. You probably need to write a batch script separated from the main program and invoke it using crontab. Checkout crontab man page

Ducky
  • 2,754
  • 16
  • 25