@joystick.js/node-canary 0.0.0-canary.441 → 0.0.0-canary.442

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import r from"cluster";import t from"os";const p=(c=null)=>{const n=t.cpus().length;if(r.isPrimary){for(let s=0;s<n;s++){const e=r.fork();e.process.env.joystick_process=s+1,e.on("message",o=>{process.send&&process.send(o)}),process.on("message",o=>{e.send(o)})}r.on("exit",s=>{console.warn(`Worker ${s.process.pid} died.`)})}else c()};var d=p;export{d as default};
1
+ import r from"cluster";import n from"os";const p=(c=null)=>{const t=n.cpus().length;if(r.isPrimary){for(let s=0;s<t;s++){const e=r.fork();e.process.joystick_process=s+1,e.on("message",o=>{process.send&&process.send(o)}),process.on("message",o=>{e.send(o)})}r.on("exit",s=>{console.warn(`Worker ${s.process.pid} died.`)})}else c()};var d=p;export{d as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.441",
4
+ "version": "0.0.0-canary.442",
5
5
  "description": "The Node.js framework for Joystick.",
6
6
  "main": "./dist/index.js",
7
7
  "scripts": {
@@ -11,7 +11,7 @@ const start_node_as_cluster = (callback = null) => {
11
11
  // NOTE: Intentionally track the worker index on its process so we can
12
12
  // check for a primary in our code (e.g., when running cluster of an app that
13
13
  // has code we only want to run on 1/X workers, not all workers).
14
- worker.process.env.joystick_process = i + 1;
14
+ worker.process.joystick_process = i + 1;
15
15
 
16
16
  worker.on("message", (message) => {
17
17
  if (process.send) {