@nsshunt/stsrunnerframework 1.0.74 → 1.0.75
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.
- package/dist/stsrunnerframework.mjs +11 -11
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +11 -11
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +5 -2
- package/types/commonTypes.d.ts.map +1 -1
- package/types/workerManager.d.ts +2 -2
- package/types/workerManager.d.ts.map +1 -1
|
@@ -2072,7 +2072,7 @@ class STSWorkerManager {
|
|
|
2072
2072
|
__privateAdd(this, _debug2, (message) => {
|
|
2073
2073
|
console.log(chalk.cyan(`pid: [${process.pid}] STSWorkerManager::${message}`));
|
|
2074
2074
|
});
|
|
2075
|
-
__publicField(this, "AddWorker", async (useWorkerFactory) => {
|
|
2075
|
+
__publicField(this, "AddWorker", async (workerOptions, useWorkerFactory) => {
|
|
2076
2076
|
let workerFactory;
|
|
2077
2077
|
if (useWorkerFactory) {
|
|
2078
2078
|
workerFactory = useWorkerFactory;
|
|
@@ -2090,7 +2090,7 @@ class STSWorkerManager {
|
|
|
2090
2090
|
id: workerId,
|
|
2091
2091
|
worker: workerFactory.createWorkerThreadWorker(),
|
|
2092
2092
|
messagePort: port1,
|
|
2093
|
-
|
|
2093
|
+
options: workerOptions,
|
|
2094
2094
|
runnersEx: {},
|
|
2095
2095
|
runnersEvents: {},
|
|
2096
2096
|
GetRunner: (id) => __privateGet(this, _workersEx)[workerId].GetRunner(id),
|
|
@@ -2119,13 +2119,13 @@ class STSWorkerManager {
|
|
|
2119
2119
|
}
|
|
2120
2120
|
__privateGet(this, _debug2).call(this, `Adding worker: [${stsWorkerEx.id}]`);
|
|
2121
2121
|
__privateGet(this, _debug2).call(this, `AddWorker::workerThreadWorkerOptions: [${stsWorkerEx.id}]`);
|
|
2122
|
-
if (stsWorkerEx.
|
|
2122
|
+
if (stsWorkerEx.options.mocked) {
|
|
2123
2123
|
stsWorkerEx.worker.SetPort({
|
|
2124
2124
|
command: eIWMessageCommands.MessagePort,
|
|
2125
2125
|
payload: {
|
|
2126
2126
|
port: port2,
|
|
2127
2127
|
options: {
|
|
2128
|
-
...stsWorkerEx.
|
|
2128
|
+
...stsWorkerEx.options
|
|
2129
2129
|
},
|
|
2130
2130
|
workerId
|
|
2131
2131
|
}
|
|
@@ -2135,12 +2135,12 @@ class STSWorkerManager {
|
|
|
2135
2135
|
port: port2,
|
|
2136
2136
|
//applicationStoreState: stateCopy,
|
|
2137
2137
|
options: {
|
|
2138
|
-
...stsWorkerEx.
|
|
2138
|
+
...stsWorkerEx.options
|
|
2139
2139
|
},
|
|
2140
2140
|
workerId
|
|
2141
2141
|
}, port2);
|
|
2142
2142
|
}
|
|
2143
|
-
if (!stsWorkerEx.
|
|
2143
|
+
if (!stsWorkerEx.options.mocked) {
|
|
2144
2144
|
if (isNode) {
|
|
2145
2145
|
stsWorkerEx.worker.on("exit", (code) => {
|
|
2146
2146
|
console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker exited with code: ${code}`));
|
|
@@ -2271,10 +2271,10 @@ class STSWorkerManager {
|
|
|
2271
2271
|
const asyncRunnerContext = {
|
|
2272
2272
|
// [level1]@[level2]^[level3]|[level4]
|
|
2273
2273
|
// [hostName]@[agentId]-[userAgent]^[workerId]|[runnerId]
|
|
2274
|
-
nid: `${workerEx.
|
|
2275
|
-
hostName: workerEx.
|
|
2274
|
+
nid: `${workerEx.options.hostName}${ModelDelimeter.COMPONENT_SEPERATOR}${workerEx.options.agentId}-${workerEx.options.userAgent}${ModelDelimeter.NID_SEPERATOR}${workerEx.id}${ModelDelimeter.SEPERATOR}${runnerId}`,
|
|
2275
|
+
hostName: workerEx.options.hostName,
|
|
2276
2276
|
// level 1 (e.g. host name)
|
|
2277
|
-
agentName: `${workerEx.
|
|
2277
|
+
agentName: `${workerEx.options.agentId}-${workerEx.options.userAgent}`,
|
|
2278
2278
|
// level 2 (e.g. service instance ID or user agent type and tab or instance)
|
|
2279
2279
|
threadId: `${workerEx.id}`,
|
|
2280
2280
|
// level 3 (web worker)
|
|
@@ -2579,10 +2579,10 @@ class STSWorkerManager {
|
|
|
2579
2579
|
return retVal;
|
|
2580
2580
|
}
|
|
2581
2581
|
CreateWorkerCopy(workerEx) {
|
|
2582
|
-
const { id,
|
|
2582
|
+
const { id, options, runnersEx } = workerEx;
|
|
2583
2583
|
const workerCopy = {
|
|
2584
2584
|
id,
|
|
2585
|
-
|
|
2585
|
+
options: { ...options },
|
|
2586
2586
|
runners: {}
|
|
2587
2587
|
};
|
|
2588
2588
|
for (const [, runnerEx] of Object.entries(runnersEx)) {
|