0

I would like to get a multi-process node, working with Sequelize. As you can't call Sequelize's sync method to get your orm ready multiple time at once (database locking), I decided to call the sync method on the master cluster. When that's done, fork the process to match CPU count.

But I can't obviously share global variables across the forks, and if I try to pass the Sequelize variable through the environnement (http://nodejs.org/api/cluster.html#cluster_cluster_fork_env) or with worker.message(data) and process.on (http://nodejs.org/api/cluster.html#cluster_worker_send_message_sendhandle), it won't send circular JSON..

So I'm wondering how to pass complex/circular object to a child process.

Does anyone have any idea ?

Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
Extaze
  • 1,117
  • 2
  • 10
  • 18

0 Answers0