hexok 2.2.1 → 2.2.2
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/package.json
CHANGED
package/skills/hexok/SKILL.md
CHANGED
|
@@ -86,7 +86,7 @@ An adapter is the concrete port: memory while sketching, a database in the API,
|
|
|
86
86
|
|
|
87
87
|
Read [references/mapper.md](references/mapper.md) when the stored document is a different shape from the domain props. Persisting `toProps()` as JSON needs no mapper.
|
|
88
88
|
|
|
89
|
-
The publisher adapter accepts `EventInstance<typeof Catalog>`. It sends `Catalog.message(event)` when the transport stores bytes. The subscription adapter runs `Catalog.parse` and then `handle`. Ack, retry, prefetch, and consumer groups stay on that adapter.
|
|
89
|
+
The publisher adapter accepts `EventInstance<typeof Catalog>`. It sends `Catalog.message(event)` when the transport stores bytes. The subscription adapter runs `Catalog.parse` and then `handle`. Ack, retry, prefetch, and consumer groups stay on that adapter. The application sets `maxDeliveries` on `subscribe`. The adapter enforces it. The lease stays on the adapter.
|
|
90
90
|
|
|
91
91
|
### 5. Gateway
|
|
92
92
|
|
|
@@ -48,7 +48,7 @@ Store `toProps()` (or a mapped document) and rebuild with `restore` on the way o
|
|
|
48
48
|
|
|
49
49
|
The defaults of `start` and `stop` resolve immediately, so an in-memory adapter can leave them alone. A database adapter overrides `start` to connect and `stop` to disconnect. The application calls them. The use case calls `get` and `save`.
|
|
50
50
|
|
|
51
|
-
A publisher adapter accepts the catalog instance and, on a real transport, sends `BlogEvents.message(event)`. A subscription adapter owns the consumer loop. It parses with `BlogEvents.parse`, then calls each subscribed handler. It does not hide handler errors. Ack, retry, prefetch, and consumer groups live here, and only when the broker has them.
|
|
51
|
+
A publisher adapter accepts the catalog instance and, on a real transport, sends `BlogEvents.message(event)`. A subscription adapter owns the consumer loop. It parses with `BlogEvents.parse`, then calls each subscribed handler. It does not hide handler errors. Ack, retry, prefetch, and consumer groups live here, and only when the broker has them. The application sets `maxDeliveries` on `subscribe`. The adapter enforces it. The lease stays on the adapter.
|
|
52
52
|
|
|
53
53
|
One adapter implements one port. A second port is a second class.
|
|
54
54
|
|
|
@@ -38,7 +38,7 @@ class EmailSubscribers extends EventHandler('email.subscribers', PostPublished)
|
|
|
38
38
|
|
|
39
39
|
Annotate `event` with `PostPublished`. An unannotated `handle(event)` is implicit `any`. Keep `handle` a method.
|
|
40
40
|
|
|
41
|
-
A process that shares the API's memory can pass the instance straight to `handle`. A worker in another process can parse with `handler.event.parse` when the message is that event's payload, or read a catalog message, run `BlogEvents.parse`, and then call `handle`. Subscription, ack, and retry belong to that adapter. The instance `token` and `event` are the same values as the statics.
|
|
41
|
+
A process that shares the API's memory can pass the instance straight to `handle`. A worker in another process can parse with `handler.event.parse` when the message is that event's payload, or read a catalog message, run `BlogEvents.parse`, and then call `handle`. Subscription, ack, and retry belong to that adapter. The application sets `maxDeliveries` on `subscribe`. The adapter enforces it. The lease stays on the adapter. The instance `token` and `event` are the same values as the statics.
|
|
42
42
|
|
|
43
43
|
One handler is bound to one event class. A second event is a second handler.
|
|
44
44
|
|