node:cluster
#Import
import cluster from "nstdlib/node/cluster";Note
The API is available, but not everything works. No process spawning.
#Support
- nstd: Gives the same output as Node.js in side-by-side tests: cold.
- Browser: Loads with a minimal
processobject. 15 of Node's 15 exports are available. No behavior check covers it yet.
#Exports (16)
Every name Node.js exports from this module, and what you get when you read it, as a named import or as a property of the default import:
- ✅ A value, both ways. An export that throws an error naming the missing feature also counts.
- ⚠️ A value one way,
undefinedthe other. - ❔
undefinedboth ways. - ❌ Not exported at all.
- – Not measured.
| Export | Node.js | Browser |
|---|---|---|
SCHED_NONE | ✅ | ✅ |
SCHED_RR | ✅ | ✅ |
Worker | ✅ | ✅ |
_events | ✅ | ✅ |
_eventsCount | ✅ | ✅ |
_maxListeners | ❔ | ❌ |
disconnect | ✅ | ✅ |
fork | ✅ | ✅ |
isMaster | ✅ | ✅ |
isPrimary | ✅ | ✅ |
isWorker | ✅ | ✅ |
schedulingPolicy | ✅ | ✅ |
settings | ✅ | ✅ |
setupMaster | ✅ | ✅ |
setupPrimary | ✅ | ✅ |
workers | ✅ | ✅ |
#Diagnostics
nstdlib running inside Node.js. This isn't an environment it's meant for, so it isn't shown above, but it tells a library problem from an environment one:
coverage: 16/16 of the host's export names answer inside host node. API only. No process spawning.smoke: Imports in a clean child process.node-suite: 6/81 of Node's own eligible tests pass with ./dist inside host node. A failure there and in the page is the library's, one only in the page is the engine's.