@nwire/queue 0.12.1 → 0.13.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/dist/queue-worker.js +15 -4
- package/package.json +9 -9
package/dist/queue-worker.js
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
* Wire-mode invariance: domain handlers are the same in HTTP and queue wires.
|
|
25
25
|
* The framework decides where dispatch happens; the handler is unchanged.
|
|
26
26
|
*/
|
|
27
|
-
import { forgeDispatcher } from "@nwire/forge";
|
|
28
27
|
/**
|
|
29
28
|
* Build a `QueueSubscription` with a chainable `.from(source)` method.
|
|
30
29
|
* Equivalent to writing the object literal by hand but adds the fluent
|
|
@@ -67,9 +66,21 @@ export function createQueueWorker(app, transport, options) {
|
|
|
67
66
|
// Combine worker-stop + per-job signals so the handler
|
|
68
67
|
// sees an abort if EITHER source fires.
|
|
69
68
|
const combined = combineSignals(workerController.signal, jobSignal);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
// Unified inbound — the queued job becomes a command on the
|
|
70
|
+
// runtime's source chain. The stored envelope is the parent so
|
|
71
|
+
// the dispatch stays in the original correlation chain; `target`
|
|
72
|
+
// is the resolved forge handler (route-by-ref) so it lands on the
|
|
73
|
+
// one execute path. Source stages (dedup, …) run before it.
|
|
74
|
+
const handler = app.runtime.getHandler(subscription.action.name);
|
|
75
|
+
await app.runtime.receive({
|
|
76
|
+
kind: "command",
|
|
77
|
+
name: subscription.action.name,
|
|
78
|
+
input: msg.input,
|
|
79
|
+
// The forge action satisfies the runtime's execute target
|
|
80
|
+
// structurally; the nominal types differ across the
|
|
81
|
+
// forge↔runtime boundary, so cast as elsewhere.
|
|
82
|
+
target: handler,
|
|
83
|
+
}, { parent: msg.envelope, signal: combined });
|
|
73
84
|
});
|
|
74
85
|
}
|
|
75
86
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nwire/queue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Nwire — queue transport contract + InMemory default + createQueueWorker. Production adapters land as @nwire/bullmq, @nwire/queue-sqs, @nwire/queue-pgboss.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bus",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nwire/app": "0.
|
|
32
|
-
"@nwire/container": "0.
|
|
33
|
-
"@nwire/
|
|
34
|
-
"@nwire/
|
|
35
|
-
"@nwire/
|
|
36
|
-
"@nwire/
|
|
37
|
-
"@nwire/
|
|
31
|
+
"@nwire/app": "0.13.1",
|
|
32
|
+
"@nwire/container": "0.13.1",
|
|
33
|
+
"@nwire/endpoint": "0.13.1",
|
|
34
|
+
"@nwire/envelope": "0.13.1",
|
|
35
|
+
"@nwire/forge": "0.13.1",
|
|
36
|
+
"@nwire/wires": "0.13.1",
|
|
37
|
+
"@nwire/logger": "0.13.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.19.9",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
42
|
"vitest": "^4.0.18",
|
|
43
43
|
"zod": "^4.0.0",
|
|
44
|
-
"@nwire/messages": "0.
|
|
44
|
+
"@nwire/messages": "0.13.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsc && node ../../scripts/fix-dist-extensions.mjs dist",
|