(I already asked about this on StackOverflow here and after a brief discussion I was suggested to propose this as a full-fledged issue.)
As far as my understanding goes, whenever I use child_process.fork from my main script to launch another script, the flag ELECTRON_RUN_AS_NODE will be set, so that the child process will just behave as a simple node environment. This means I will not be able to require electron, open windows, or do anything that electron does.
Is there a reason why users are not allowed to choose wether or not they would like to do GUI operations in the child process? If not, it would be great to allow users to possibly override the default set ELECTRON_RUN_AS_NODE and get windows and everything in the child process.
I was already suggested to use child_process.spawn on the electron executable, but that feels slightly dirty and also child_process.fork has a wonderful IPC interface that makes everything easy.
Would it be possible to do such a thing?
(I already asked about this on StackOverflow here and after a brief discussion I was suggested to propose this as a full-fledged issue.)
As far as my understanding goes, whenever I use
child_process.forkfrom my main script to launch another script, the flagELECTRON_RUN_AS_NODEwill be set, so that the child process will just behave as a simple node environment. This means I will not be able torequireelectron, open windows, or do anything that electron does.Is there a reason why users are not allowed to choose wether or not they would like to do GUI operations in the child process? If not, it would be great to allow users to possibly override the default set
ELECTRON_RUN_AS_NODEand get windows and everything in the child process.I was already suggested to use
child_process.spawnon the electron executable, but that feels slightly dirty and alsochild_process.forkhas a wonderful IPC interface that makes everything easy.Would it be possible to do such a thing?