nestworker 2.0.8 → 2.1.1
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/README.md +388 -117
- package/dist/core/worker.interfaces.d.ts +89 -10
- package/dist/core/worker.module.d.ts +21 -11
- package/dist/core/worker.module.js +38 -10
- package/dist/core/worker.module.js.map +1 -1
- package/dist/core/worker.pool.d.ts +26 -6
- package/dist/core/worker.pool.js +288 -103
- package/dist/core/worker.pool.js.map +1 -1
- package/dist/core/worker.service.d.ts +28 -74
- package/dist/core/worker.service.js +132 -79
- package/dist/core/worker.service.js.map +1 -1
- package/dist/decorators/worker-task.decorator.d.ts +7 -25
- package/dist/decorators/worker-task.decorator.js +5 -26
- package/dist/decorators/worker-task.decorator.js.map +1 -1
- package/dist/discovery/discovery.service.d.ts +2 -9
- package/dist/discovery/discovery.service.js +86 -21
- package/dist/discovery/discovery.service.js.map +1 -1
- package/dist/example/bench.d.ts +13 -0
- package/dist/example/bench.js +85 -0
- package/dist/example/bench.js.map +1 -0
- package/dist/example/main.js +14 -2
- package/dist/example/main.js.map +1 -1
- package/dist/health/worker.health.d.ts +46 -0
- package/dist/health/worker.health.js +77 -0
- package/dist/health/worker.health.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics/worker.metrics.d.ts +65 -0
- package/dist/metrics/worker.metrics.js +122 -0
- package/dist/metrics/worker.metrics.js.map +1 -0
- package/dist/worker/worker-runtime.js +139 -29
- package/dist/worker/worker-runtime.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,55 +1,165 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
4
|
+
const node_async_hooks_1 = require("node:async_hooks");
|
|
4
5
|
const worker_container_1 = require("../di/worker-container");
|
|
5
|
-
/**
|
|
6
|
-
* Worker Runtime – entry point for every worker thread.
|
|
7
|
-
*
|
|
8
|
-
* Receives SerializedService[] via workerData and boots a WorkerContainer
|
|
9
|
-
* which eval()s the stripped class sources and reconstructs the full
|
|
10
|
-
* service graph (deps injected via constructor) without any require() calls
|
|
11
|
-
* into NestJS-annotated files.
|
|
12
|
-
*
|
|
13
|
-
* Jobs are processed serially via a queue — one postMessage() reply per job,
|
|
14
|
-
* which is exactly what the pool's worker.once('message') expects.
|
|
15
|
-
*/
|
|
16
6
|
const services = node_worker_threads_1.workerData?.services ?? [];
|
|
17
7
|
const container = new worker_container_1.WorkerContainer();
|
|
18
8
|
container.load(services);
|
|
19
|
-
|
|
20
|
-
const tasks = {};
|
|
9
|
+
const instances = new Map();
|
|
21
10
|
for (const svc of services) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
instances.set(svc.name, container.get(svc.name));
|
|
12
|
+
}
|
|
13
|
+
node_worker_threads_1.parentPort?.postMessage({ type: 'worker:ready' });
|
|
14
|
+
// ── Pending IPC calls ─────────────────────────────────────────────────────
|
|
15
|
+
const pendingIpc = new Map();
|
|
16
|
+
// ── Pending AbortControllers (keyed by abortSignalId) ────────────────────
|
|
17
|
+
const pendingAborts = new Map();
|
|
18
|
+
// ── Internal ALS for context propagation ─────────────────────────────────
|
|
19
|
+
// One ALS instance per context key — we use a single generic ALS that holds
|
|
20
|
+
// the full context map, then the user's ALS instances read from it via
|
|
21
|
+
// the context restoration path in WorkerService.
|
|
22
|
+
const workerAls = new node_async_hooks_1.AsyncLocalStorage();
|
|
23
|
+
node_worker_threads_1.parentPort?.on('message', (msg) => {
|
|
24
|
+
const message = msg;
|
|
25
|
+
// IPC result from main thread
|
|
26
|
+
if (message.type === 'ipc:result') {
|
|
27
|
+
const res = message;
|
|
28
|
+
const pending = pendingIpc.get(res.callId);
|
|
29
|
+
if (!pending)
|
|
30
|
+
return;
|
|
31
|
+
pendingIpc.delete(res.callId);
|
|
32
|
+
res.ok ? pending.resolve(res.data) : pending.reject(new Error(res.error ?? 'IPC failed'));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Abort signal from main thread
|
|
36
|
+
if (message.type === 'abort') {
|
|
37
|
+
const abort = message;
|
|
38
|
+
pendingAborts.get(abort.abortSignalId)?.abort();
|
|
39
|
+
return;
|
|
25
40
|
}
|
|
41
|
+
// Normal job
|
|
42
|
+
queue.push(message);
|
|
43
|
+
runNext();
|
|
44
|
+
});
|
|
45
|
+
function buildProxy(descriptor) {
|
|
46
|
+
const proxy = {};
|
|
47
|
+
const propertyKey = descriptor.propertyKey;
|
|
48
|
+
for (const methodName of descriptor.methodNames) {
|
|
49
|
+
proxy[methodName] = (...args) => new Promise((resolve, reject) => {
|
|
50
|
+
const callId = nextCallId();
|
|
51
|
+
pendingIpc.set(callId, { resolve, reject });
|
|
52
|
+
const request = {
|
|
53
|
+
type: 'ipc:invoke', callId,
|
|
54
|
+
propertyKey,
|
|
55
|
+
methodName, args,
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
node_worker_threads_1.parentPort.postMessage(request);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
pendingIpc.delete(callId);
|
|
62
|
+
reject(new Error(`IPC proxy "${propertyKey}.${methodName}" could not serialise args: ` +
|
|
63
|
+
`${err.message}`));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return proxy;
|
|
26
68
|
}
|
|
69
|
+
// Counter-based call IDs — far cheaper than crypto.randomUUID() and only
|
|
70
|
+
// need to be unique within this worker process.
|
|
71
|
+
let __callCounter = 0;
|
|
72
|
+
const nextCallId = () => 'c' + (++__callCounter).toString(36);
|
|
27
73
|
const queue = [];
|
|
28
74
|
let busy = false;
|
|
29
75
|
async function runNext() {
|
|
30
76
|
if (busy || queue.length === 0)
|
|
31
77
|
return;
|
|
32
78
|
busy = true;
|
|
33
|
-
const
|
|
34
|
-
|
|
79
|
+
const job = queue.shift();
|
|
80
|
+
// Set up AbortController for this job
|
|
81
|
+
const abortController = new AbortController();
|
|
82
|
+
if (job.abortSignalId) {
|
|
83
|
+
pendingAborts.set(job.abortSignalId, abortController);
|
|
84
|
+
}
|
|
85
|
+
// Inject proxy stubs
|
|
86
|
+
if (job.proxyServices?.length) {
|
|
87
|
+
const inst = instances.get(job.serviceName);
|
|
88
|
+
if (inst) {
|
|
89
|
+
for (const descriptor of job.proxyServices) {
|
|
90
|
+
inst[descriptor.propertyKey] = buildProxy(descriptor);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Restore ALS context and run the task inside it
|
|
95
|
+
const alsContext = job.alsContext;
|
|
96
|
+
const hasAls = alsContext && hasOwnKeys(alsContext);
|
|
97
|
+
const run = async () => {
|
|
98
|
+
const inst = instances.get(job.serviceName);
|
|
99
|
+
if (!inst)
|
|
100
|
+
throw new Error(`Service "${job.serviceName}" is not registered`);
|
|
101
|
+
const fn = inst[job.methodName];
|
|
102
|
+
if (typeof fn !== 'function') {
|
|
103
|
+
throw new Error(`Task "${job.serviceName}.${job.methodName}" is not registered`);
|
|
104
|
+
}
|
|
105
|
+
// Inject AbortSignal as a last argument if the job has an abortSignalId.
|
|
106
|
+
// Call via inst.method() — not as a detached fn() — so `this` is preserved.
|
|
107
|
+
const args = job.abortSignalId
|
|
108
|
+
? [...job.args, abortController.signal]
|
|
109
|
+
: job.args;
|
|
110
|
+
return inst[job.methodName](...args);
|
|
111
|
+
};
|
|
35
112
|
try {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
node_worker_threads_1.parentPort?.postMessage({ ok: true, data });
|
|
113
|
+
// Skip the ALS wrapper entirely when there's no context to propagate —
|
|
114
|
+
// ALS.run() has measurable overhead (async-hooks resource tracking).
|
|
115
|
+
const data = hasAls ? await workerAls.run(alsContext, run) : await run();
|
|
116
|
+
node_worker_threads_1.parentPort.postMessage({ ok: true, data });
|
|
41
117
|
}
|
|
42
118
|
catch (error) {
|
|
43
119
|
const e = error;
|
|
44
|
-
|
|
120
|
+
const serialized = {
|
|
121
|
+
name: e.name ?? 'Error',
|
|
122
|
+
message: e.message,
|
|
123
|
+
stack: e.stack,
|
|
124
|
+
code: e.code,
|
|
125
|
+
// Capture any extra own enumerable properties (e.g. HttpException.status)
|
|
126
|
+
extra: serializeExtraProps(e),
|
|
127
|
+
};
|
|
128
|
+
node_worker_threads_1.parentPort.postMessage({ ok: false, error: serialized });
|
|
45
129
|
}
|
|
46
130
|
finally {
|
|
131
|
+
if (job.abortSignalId) {
|
|
132
|
+
pendingAborts.delete(job.abortSignalId);
|
|
133
|
+
}
|
|
47
134
|
busy = false;
|
|
48
|
-
|
|
135
|
+
if (queue.length > 0)
|
|
136
|
+
runNext();
|
|
49
137
|
}
|
|
50
138
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
139
|
+
function hasOwnKeys(obj) {
|
|
140
|
+
// Cheaper than Object.keys(obj).length > 0 — no array allocation.
|
|
141
|
+
// noinspection LoopStatementThatDoesntLoopJS
|
|
142
|
+
for (const _k in obj) {
|
|
143
|
+
void _k;
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
function serializeExtraProps(err) {
|
|
149
|
+
const skip = new Set(['name', 'message', 'stack', 'code']);
|
|
150
|
+
const extra = {};
|
|
151
|
+
let hasExtra = false;
|
|
152
|
+
for (const key of Object.keys(err)) {
|
|
153
|
+
if (skip.has(key))
|
|
154
|
+
continue;
|
|
155
|
+
try {
|
|
156
|
+
structuredClone(err[key]);
|
|
157
|
+
extra[key] = err[key];
|
|
158
|
+
hasExtra = true;
|
|
159
|
+
}
|
|
160
|
+
catch { /* skip non-cloneable */
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return hasExtra ? extra : undefined;
|
|
164
|
+
}
|
|
55
165
|
//# sourceMappingURL=worker-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-runtime.js","sourceRoot":"","sources":["../../src/worker/worker-runtime.ts"],"names":[],"mappings":";;AAAA,6DAA6D;AAC7D,6DAAyD;
|
|
1
|
+
{"version":3,"file":"worker-runtime.js","sourceRoot":"","sources":["../../src/worker/worker-runtime.ts"],"names":[],"mappings":";;AAAA,6DAA6D;AAC7D,uDAAqD;AACrD,6DAAyD;AAYzD,MAAM,QAAQ,GAAwB,gCAAU,EAAE,QAAQ,IAAI,EAAE,CAAC;AACjE,MAAM,SAAS,GAAG,IAAI,kCAAe,EAAE,CAAC;AACxC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAIzB,MAAM,SAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;AACrD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC3B,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAkB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,gCAAU,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;AAElD,6EAA6E;AAC7E,MAAM,UAAU,GAAG,IAAI,GAAG,EAGvB,CAAC;AAEJ,4EAA4E;AAC5E,MAAM,aAAa,GAAG,IAAI,GAAG,EAA2B,CAAC;AAEzD,4EAA4E;AAC5E,4EAA4E;AAC5E,uEAAuE;AACvE,iDAAiD;AACjD,MAAM,SAAS,GAAG,IAAI,oCAAiB,EAA2B,CAAC;AAEnE,gCAAU,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,GAAY,EAAE,EAAE;IACzC,MAAM,OAAO,GAAG,GAA2B,CAAC;IAE5C,8BAA8B;IAC9B,IAAK,OAA6B,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACzD,MAAM,GAAG,GAAG,OAA4B,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAA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AAS;QAC5B,IAAI,CAAC;YACH,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1B,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YACtB,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC,CAAC,wBAAwB;QAClC,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestworker",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Enterprise-grade worker thread module for NestJS — priority pool, auto-discovery, DI in workers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"build": "tsc -p tsconfig.build.json",
|
|
14
14
|
"build:watch": "tsc -p tsconfig.build.json --watch",
|
|
15
15
|
"example": "npm run build && node dist/example/main.js",
|
|
16
|
+
"bench": "npm run build && node dist/example/bench.js",
|
|
16
17
|
"prepublishOnly": "npm run build"
|
|
17
18
|
},
|
|
18
19
|
"keywords": [
|