@nwire/queue 0.12.0 → 0.13.0

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.
@@ -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
- await forgeDispatcher(app).dispatch(subscription.action, msg.input, msg.envelope, {
71
- signal: combined,
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.12.0",
3
+ "version": "0.13.0",
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.12.0",
32
- "@nwire/container": "0.12.0",
33
- "@nwire/endpoint": "0.12.0",
34
- "@nwire/forge": "0.12.0",
35
- "@nwire/wires": "0.12.0",
36
- "@nwire/logger": "0.12.0",
37
- "@nwire/envelope": "0.12.0"
31
+ "@nwire/app": "0.13.0",
32
+ "@nwire/container": "0.13.0",
33
+ "@nwire/endpoint": "0.13.0",
34
+ "@nwire/forge": "0.13.0",
35
+ "@nwire/envelope": "0.13.0",
36
+ "@nwire/logger": "0.13.0",
37
+ "@nwire/wires": "0.13.0"
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.12.0"
44
+ "@nwire/messages": "0.13.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsc && node ../../scripts/fix-dist-extensions.mjs dist",