@nsshunt/stsrunnerframework 1.0.129 → 1.0.130
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.
|
@@ -1549,7 +1549,11 @@ class WorkerInstance {
|
|
|
1549
1549
|
for (let i = 0; i < removeList.length; i++) {
|
|
1550
1550
|
__privateGet(this, _runners)[removeList[i]].archived = true;
|
|
1551
1551
|
if (__privateGet(this, _archiveDeleteTimeout) !== 0) {
|
|
1552
|
-
|
|
1552
|
+
if (isNode) {
|
|
1553
|
+
setTimeout(() => delete __privateGet(this, _runners)[removeList[i]], __privateGet(this, _archiveDeleteTimeout) * 1e3).unref();
|
|
1554
|
+
} else {
|
|
1555
|
+
setTimeout(() => delete __privateGet(this, _runners)[removeList[i]], __privateGet(this, _archiveDeleteTimeout) * 1e3);
|
|
1556
|
+
}
|
|
1553
1557
|
}
|
|
1554
1558
|
}
|
|
1555
1559
|
__privateGet(this, _debug).call(this, chalk.grey(`WorkerInstance:#processLoopExecutor(): Remaining Runner Count: [${Object.keys(__privateGet(this, _runners)).length}]`));
|
|
@@ -1576,12 +1580,12 @@ class WorkerInstance {
|
|
|
1576
1580
|
__privateSet(this, _collectorCollectorPort, workerMessagePort.port);
|
|
1577
1581
|
if (isNode) {
|
|
1578
1582
|
__privateGet(this, _collectorCollectorPort).on("message", (data) => {
|
|
1579
|
-
__privateGet(this, _debug).call(this, `collectorCollectorPort
|
|
1583
|
+
__privateGet(this, _debug).call(this, `collectorCollectorPort on('message'): ${JSON.stringify(data)}`);
|
|
1580
1584
|
});
|
|
1581
1585
|
} else {
|
|
1582
|
-
__privateGet(this, _collectorCollectorPort).
|
|
1583
|
-
__privateGet(this, _debug).call(this, `collectorCollectorPort
|
|
1584
|
-
};
|
|
1586
|
+
__privateGet(this, _collectorCollectorPort).addEventListener("message", (data) => {
|
|
1587
|
+
__privateGet(this, _debug).call(this, `collectorCollectorPort addEventListener('message'): ${JSON.stringify(data.data)}`);
|
|
1588
|
+
});
|
|
1585
1589
|
}
|
|
1586
1590
|
const response = {
|
|
1587
1591
|
command: eIWMessageCommands.MessagePortResponse,
|
|
@@ -2326,7 +2330,11 @@ class STSWorkerManager {
|
|
|
2326
2330
|
}
|
|
2327
2331
|
runnerEx.archived = true;
|
|
2328
2332
|
if (__privateGet(this, _archiveDeleteTimeout2) !== 0) {
|
|
2329
|
-
|
|
2333
|
+
if (isNode) {
|
|
2334
|
+
setTimeout(() => delete workerEx.runnersEx[removeList[i].runnerId], __privateGet(this, _archiveDeleteTimeout2) * 1e3).unref();
|
|
2335
|
+
} else {
|
|
2336
|
+
setTimeout(() => delete workerEx.runnersEx[removeList[i].runnerId], __privateGet(this, _archiveDeleteTimeout2) * 1e3);
|
|
2337
|
+
}
|
|
2330
2338
|
}
|
|
2331
2339
|
}
|
|
2332
2340
|
}
|
|
@@ -2413,6 +2421,9 @@ class STSWorkerManager {
|
|
|
2413
2421
|
port2
|
|
2414
2422
|
// collector message port
|
|
2415
2423
|
} = new MessageChannel();
|
|
2424
|
+
if (!isNode) {
|
|
2425
|
+
port1.start();
|
|
2426
|
+
}
|
|
2416
2427
|
const workerId = v4();
|
|
2417
2428
|
const stsWorkerEx = {
|
|
2418
2429
|
id: workerId,
|
|
@@ -2554,10 +2565,10 @@ class STSWorkerManager {
|
|
|
2554
2565
|
processMessage(publishMessagePayload);
|
|
2555
2566
|
});
|
|
2556
2567
|
} else {
|
|
2557
|
-
stsWorkerEx.messagePort.
|
|
2568
|
+
stsWorkerEx.messagePort.addEventListener("message", (data) => {
|
|
2558
2569
|
publishMessagePayload = data.data;
|
|
2559
2570
|
processMessage(publishMessagePayload);
|
|
2560
|
-
};
|
|
2571
|
+
});
|
|
2561
2572
|
}
|
|
2562
2573
|
__privateGet(this, _workersEx)[stsWorkerEx.id] = stsWorkerEx;
|
|
2563
2574
|
__privateGet(this, _debug2).call(this, `Added worker: [${stsWorkerEx.id}]`);
|