Instead of messing with process._eval I decided to find where node starts 
the main code. Turns out things work fine if you add the clustering code in 
`lib/module.js`'s runMain function. 

On Tuesday, September 30, 2014 11:55:12 PM UTC-5, Adam Snodgrass wrote:
>
> I'm currently working on a project that requires compiling the source into 
> node.js (0.10.32). After moving all the source files into 
> `lib/`,referencing them in node.gyp and some other work, I add 
> `process._eval = 'require("app");';` to `src/node.js`. This works fine but 
> if I try using the cluster module, it causes problems. 
>
> I found that I could remove the `process._eval` line and move the cluster 
> setup code to a separate external file that requires the app module and 
> execute it with node it works fine. So I was able to narrow the issue down 
> to the eval option by testing the following:
>
> https://gist.github.com/overra/80149efda83738f62582
>
> I was curious what `worker` was assigned to so I modified the 
> `lib/cluster.js`  file to `console.log(worker);` and it was `{}`, which 
> explains the missing method. I'd like to investigate this further but I'm 
> hoping someone else has run into this issue previously.
>
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/7902810f-5028-436d-8fb6-f2d0de058a5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to