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 ?