MCPcopy Index your code
hub / github.com/nodejs/node / createWorkerProcess

Function createWorkerProcess

lib/internal/cluster/primary.js:118–140  ·  view source on GitHub ↗
(id, env)

Source from the content-addressed store, hash-verified

116}
117
118function createWorkerProcess(id, env) {
119 const workerEnv = { ...process.env, ...env, NODE_UNIQUE_ID: `${id}` };
120 const execArgv = [...cluster.settings.execArgv];
121
122 if (cluster.settings.inspectPort === null) {
123 throw new ERR_SOCKET_BAD_PORT('Port', null, true);
124 }
125 if (isUsingInspector(cluster.settings.execArgv)) {
126 ArrayPrototypePush(execArgv, `--inspect-port=${getInspectPort(cluster.settings.inspectPort)}`);
127 }
128
129 return fork(cluster.settings.exec, cluster.settings.args, {
130 cwd: cluster.settings.cwd,
131 env: workerEnv,
132 serialization: cluster.settings.serialization,
133 silent: cluster.settings.silent,
134 windowsHide: cluster.settings.windowsHide,
135 execArgv: execArgv,
136 stdio: cluster.settings.stdio,
137 gid: cluster.settings.gid,
138 uid: cluster.settings.uid,
139 });
140}
141
142function removeWorker(worker) {
143 assert(worker);

Callers 1

primary.jsFile · 0.85

Calls 3

isUsingInspectorFunction · 0.85
getInspectPortFunction · 0.85
forkFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…