()
| 627 | } |
| 628 | |
| 629 | #startThreads() { |
| 630 | this.#threadPool.length = 0 |
| 631 | this.#threadPoolCount = 0 |
| 632 | this.#threadCurrent = 0 |
| 633 | |
| 634 | for ( let idx = 1; idx <= this.#threadPoolMax; idx++ ) { |
| 635 | const thisThread = cp.fork(path.join(__dirname, 'queueRunner.js'), [ |
| 636 | idx |
| 637 | ]) |
| 638 | this.#threadPoolIdx.add(idx-1) |
| 639 | this.#threadPoolCount++ |
| 640 | thisThread.on('message', (m) => { this.#workQueueResponse.apply(this, [m]) }) |
| 641 | thisThread.on('exit', (m) => { this.#workQueueDone.apply(this, [m, idx-1]) }) |
| 642 | this.#threadPool.push(thisThread) |
| 643 | } |
| 644 | } |
| 645 | |
| 646 | #exitThreads() { |
| 647 | for ( const idx of this.#threadPoolIdx ) { |
no test coverage detected