@hile/message-worker-thread 4.0.4 → 4.0.5
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/AI.md +5 -0
- package/README.md +2 -0
- package/package.json +3 -3
package/AI.md
CHANGED
|
@@ -279,6 +279,9 @@ import { MessageWorkerThread } from '@hile/message-worker-thread'
|
|
|
279
279
|
- `defineMicroMessage()` handlers receive request streams as `input: Readable | undefined`, separately from structured `data` and `invocation`.
|
|
280
280
|
- `Application.call(namespace, url, data, options)` requires `options.context` and returns a promise. It accepts `options.input` for a streamed request with a normal response.
|
|
281
281
|
- `Application.stream(namespace, url, data, options)` requires `options.context` and returns a readable response stream; it can carry a request input stream at the same time.
|
|
282
|
+
- `Application.call()` and `Application.stream()` may target the application's own namespace. Self calls use the same Registry-discovered WebSocket and modem protocol as remote calls, so Context validation, request and response streams, cancellation, timeout, retry, circuit-breaker, and backpressure behavior stay uniform; business handlers do not need a local-call branch.
|
|
283
|
+
- A peer address (`host:port`) is the routing and reuse identity, not an individual WebSocket identity. If both peers dial each other concurrently, including an application dialing itself, the server preserves both physical connections while they are active instead of replacing a connection that may carry an in-flight request. Later calls still reuse the cached peer connection.
|
|
284
|
+
- This connection bookkeeping does not add or change wire frames; request, response, stream, credit, cancel, and abort protocol fields remain unchanged.
|
|
282
285
|
- `Application.call()` and `Application.stream()` default retries to `0` when request input is streamed. Explicit nonzero retries fail before service discovery because streamed input is non-replayable.
|
|
283
286
|
- A caller-owned request input source failure is surfaced as `MessageInputError`, aborts the peer invocation, and is not counted against that peer's circuit-breaker health.
|
|
284
287
|
- `Application.publish(topic, payload)` returns an object with `update()` and `unpublish()`.
|
|
@@ -290,6 +293,7 @@ import { MessageWorkerThread } from '@hile/message-worker-thread'
|
|
|
290
293
|
- Appending a secondary response getter to `client.request('/x', data)`
|
|
291
294
|
- Returning a plain object from a handler called through `stream()`.
|
|
292
295
|
- Retrying a consumed request stream or hiding it inside a replay-unsafe factory.
|
|
296
|
+
- Branching business code on whether a Micro target namespace is local or remote.
|
|
293
297
|
- Using pub/sub as a durable queue.
|
|
294
298
|
- Forgetting to register `shutdown(await app.listen(...))`.
|
|
295
299
|
|
|
@@ -297,6 +301,7 @@ import { MessageWorkerThread } from '@hile/message-worker-thread'
|
|
|
297
301
|
|
|
298
302
|
- Micro message files default-export `defineMicroMessage(...)` and receive `invocation.context`.
|
|
299
303
|
- RPC callers use `await app.call(..., { context })`.
|
|
304
|
+
- Same-namespace `call()` and `stream()` use normal Registry discovery, while `streamPeer()` keeps its exact-address selection; all three use the normal WebSocket/modem transport path and callers do not branch on locality.
|
|
300
305
|
- Streaming handlers are async generators.
|
|
301
306
|
- Request-stream handlers consume `input` and callers either pass `options.input` alongside metadata or pass a stream directly as `data`.
|
|
302
307
|
- Streamed request calls do not configure nonzero retries.
|
package/README.md
CHANGED
|
@@ -80,6 +80,7 @@ const result = await app.call('example.service', '/ping', { hello: 'world' }, {
|
|
|
80
80
|
- Appending a secondary response getter to `client.request('/x', data)`
|
|
81
81
|
- Returning a plain object from a handler called through `stream()`.
|
|
82
82
|
- Retrying a consumed request stream or hiding it inside a replay-unsafe factory.
|
|
83
|
+
- Branching business code on whether a Micro target namespace is local or remote.
|
|
83
84
|
- Using pub/sub as a durable queue.
|
|
84
85
|
- Forgetting to register `shutdown(await app.listen(...))`.
|
|
85
86
|
|
|
@@ -87,6 +88,7 @@ const result = await app.call('example.service', '/ping', { hello: 'world' }, {
|
|
|
87
88
|
|
|
88
89
|
- Micro message files default-export `defineMicroMessage(...)` and receive `invocation.context`.
|
|
89
90
|
- RPC callers use `await app.call(..., { context })`.
|
|
91
|
+
- Same-namespace `call()` and `stream()` use normal Registry discovery, while `streamPeer()` keeps its exact-address selection; all three use the normal WebSocket/modem transport path and callers do not branch on locality.
|
|
90
92
|
- Streaming handlers are async generators.
|
|
91
93
|
- Request-stream handlers consume `input` and callers either pass `options.input` alongside metadata or pass a stream directly as `data`.
|
|
92
94
|
- Streamed request calls do not configure nonzero retries.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hile/message-worker-thread",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"vitest": "^4.0.18"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@hile/message-modem": "^4.0.
|
|
26
|
+
"@hile/message-modem": "^4.0.5"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "f845e0eb6a9d56ef72d2305624ad44abcdff5063"
|
|
29
29
|
}
|