MCPcopy Create free account
hub / github.com/MultithreadedJSBook/code-samples /

Class

ch6-thread-pool/rpc-worker.js:5–5  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3const STRATEGIES = new Set([ 'roundrobin', 'random', 'leastbusy' ]);
4
5module.exports = class RpcWorkerPool {
6 constructor(path, size = 0, strategy = 'roundrobin') {
7 if (size === 0) this.size = CORES; // <1>
8 else if (size < 0) this.size = Math.max(CORES + size, 1);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected