@kairos-es/read 0.0.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.
- package/LICENSE +28 -0
- package/README.md +538 -0
- package/dist/cjs/EventLogDurability.js +184 -0
- package/dist/cjs/EventLogDurability.js.map +1 -0
- package/dist/cjs/ProjectionRunner.js +478 -0
- package/dist/cjs/ProjectionRunner.js.map +1 -0
- package/dist/cjs/ProjectionStore.js +233 -0
- package/dist/cjs/ProjectionStore.js.map +1 -0
- package/dist/cjs/foldIntoRef.js +36 -0
- package/dist/cjs/foldIntoRef.js.map +1 -0
- package/dist/cjs/inMemoryProjectionStore.js +138 -0
- package/dist/cjs/inMemoryProjectionStore.js.map +1 -0
- package/dist/cjs/index.js +128 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/projectionWiringFault.js +532 -0
- package/dist/cjs/projectionWiringFault.js.map +1 -0
- package/dist/cjs/runProjection.js +117 -0
- package/dist/cjs/runProjection.js.map +1 -0
- package/dist/cjs/runProjections.js +144 -0
- package/dist/cjs/runProjections.js.map +1 -0
- package/dist/cjs/superviseOnProgress.js +580 -0
- package/dist/cjs/superviseOnProgress.js.map +1 -0
- package/dist/cjs/testing.js +143 -0
- package/dist/cjs/testing.js.map +1 -0
- package/dist/dts/EventLogDurability.d.ts +182 -0
- package/dist/dts/EventLogDurability.d.ts.map +1 -0
- package/dist/dts/ProjectionRunner.d.ts +557 -0
- package/dist/dts/ProjectionRunner.d.ts.map +1 -0
- package/dist/dts/ProjectionStore.d.ts +475 -0
- package/dist/dts/ProjectionStore.d.ts.map +1 -0
- package/dist/dts/foldIntoRef.d.ts +39 -0
- package/dist/dts/foldIntoRef.d.ts.map +1 -0
- package/dist/dts/inMemoryProjectionStore.d.ts +11 -0
- package/dist/dts/inMemoryProjectionStore.d.ts.map +1 -0
- package/dist/dts/index.d.ts +185 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/projectionWiringFault.d.ts +260 -0
- package/dist/dts/projectionWiringFault.d.ts.map +1 -0
- package/dist/dts/runProjection.d.ts +185 -0
- package/dist/dts/runProjection.d.ts.map +1 -0
- package/dist/dts/runProjections.d.ts +480 -0
- package/dist/dts/runProjections.d.ts.map +1 -0
- package/dist/dts/superviseOnProgress.d.ts +587 -0
- package/dist/dts/superviseOnProgress.d.ts.map +1 -0
- package/dist/dts/testing.d.ts +207 -0
- package/dist/dts/testing.d.ts.map +1 -0
- package/dist/esm/EventLogDurability.js +175 -0
- package/dist/esm/EventLogDurability.js.map +1 -0
- package/dist/esm/ProjectionRunner.js +468 -0
- package/dist/esm/ProjectionRunner.js.map +1 -0
- package/dist/esm/ProjectionStore.js +223 -0
- package/dist/esm/ProjectionStore.js.map +1 -0
- package/dist/esm/foldIntoRef.js +29 -0
- package/dist/esm/foldIntoRef.js.map +1 -0
- package/dist/esm/inMemoryProjectionStore.js +131 -0
- package/dist/esm/inMemoryProjectionStore.js.map +1 -0
- package/dist/esm/index.js +185 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/projectionWiringFault.js +524 -0
- package/dist/esm/projectionWiringFault.js.map +1 -0
- package/dist/esm/runProjection.js +109 -0
- package/dist/esm/runProjection.js.map +1 -0
- package/dist/esm/runProjections.js +137 -0
- package/dist/esm/runProjections.js.map +1 -0
- package/dist/esm/superviseOnProgress.js +571 -0
- package/dist/esm/superviseOnProgress.js.map +1 -0
- package/dist/esm/testing.js +133 -0
- package/dist/esm/testing.js.map +1 -0
- package/package.json +41 -0
- package/src/EventLogDurability.ts +201 -0
- package/src/ProjectionRunner.ts +923 -0
- package/src/ProjectionStore.ts +528 -0
- package/src/foldIntoRef.ts +63 -0
- package/src/inMemoryProjectionStore.ts +163 -0
- package/src/index.ts +218 -0
- package/src/projectionWiringFault.ts +694 -0
- package/src/runProjection.ts +270 -0
- package/src/runProjections.ts +623 -0
- package/src/superviseOnProgress.ts +897 -0
- package/src/testing.ts +290 -0
- package/testing/package.json +6 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resolveProjection = exports.prepareProjection = exports.buildAndFork = exports.PipelineDied = exports.BatchSize = void 0;
|
|
7
|
+
var _codec = require("@kairos-es/codec");
|
|
8
|
+
var _core = require("@kairos-es/core");
|
|
9
|
+
var _effect = require("effect");
|
|
10
|
+
var _EventLogDurability = require("./EventLogDurability.js");
|
|
11
|
+
var _projectionWiringFault = require("./projectionWiringFault.js");
|
|
12
|
+
var _superviseOnProgress = require("./superviseOnProgress.js");
|
|
13
|
+
/**
|
|
14
|
+
* Maximum events per commit: a branded POSITIVE integer.
|
|
15
|
+
*
|
|
16
|
+
* Branded because `batchSize` is the tuning figure whose invalid values are
|
|
17
|
+
* absorbed most quietly. `Stream.groupedWithin(0, window)` does not throw and
|
|
18
|
+
* does not merely under-batch: it emits EMPTY chunks in a tight loop without
|
|
19
|
+
* ever pulling the subscription, so a projection wired with `batchSize: 0`
|
|
20
|
+
* spins a CPU for ever, commits nothing, stays at `ORIGIN`, never fails, never
|
|
21
|
+
* restarts and logs nothing — the exact silent-stall class the supervisor below
|
|
22
|
+
* exists to make loud, arriving by a route the supervisor cannot see (the
|
|
23
|
+
* breaker only counts RESTARTS, and a spinning stream never ends a run). A
|
|
24
|
+
* fractional or `NaN` size is the same mistake by a different route.
|
|
25
|
+
*
|
|
26
|
+
* The SHAPE mirrors core's `ReadLimit` — `Schema.Int`, a bound, a brand, the
|
|
27
|
+
* same fail-at-the-boundary discipline — but deliberately NOT `ReadLimit`
|
|
28
|
+
* itself, which is `>= 0`. Zero is the whole difference between the two: a
|
|
29
|
+
* `read` capped at zero events is a meaningful (if useless) request, whereas a
|
|
30
|
+
* COMMIT of zero events is not a request at all. Reusing `ReadLimit` here would
|
|
31
|
+
* import the one value that has to be rejected.
|
|
32
|
+
*
|
|
33
|
+
* A distinct brand from `MaxNoProgressRestarts` despite the identical
|
|
34
|
+
* refinement, because the two are still writable side by side in one flat
|
|
35
|
+
* options literal, are both bare integers, and differ by an order of magnitude
|
|
36
|
+
* in meaning — nominality is what makes a transposition fail to typecheck rather
|
|
37
|
+
* than silently retune the runner. That the two now tune different mechanisms
|
|
38
|
+
* (this one the pipeline, that one the supervisor) is a second reason for the
|
|
39
|
+
* distinction, not a replacement for the first.
|
|
40
|
+
*
|
|
41
|
+
* Construct with `BatchSize.make(n)`, which throws a `ParseError` at the call
|
|
42
|
+
* site rather than deferring the mistake to the first stream pull.
|
|
43
|
+
*/
|
|
44
|
+
const BatchSize = exports.BatchSize = /*#__PURE__*/_effect.Schema.Int.pipe(/*#__PURE__*/_effect.Schema.positive(), /*#__PURE__*/_effect.Schema.brand('BatchSize'));
|
|
45
|
+
/**
|
|
46
|
+
* Half the store's `catchUpPageSize` default (512), so a commit transaction stays
|
|
47
|
+
* comfortably smaller than one catch-up page while still amortising the
|
|
48
|
+
* round-trip across a couple of hundred events.
|
|
49
|
+
*/
|
|
50
|
+
const DEFAULT_BATCH_SIZE = /*#__PURE__*/BatchSize.make(256);
|
|
51
|
+
/**
|
|
52
|
+
* An order of magnitude under the store's 1-second `pollInterval` — the live
|
|
53
|
+
* tail's own latency floor — so the batching window never dominates end-to-end
|
|
54
|
+
* lag.
|
|
55
|
+
*/
|
|
56
|
+
const DEFAULT_BATCH_WINDOW = '50 millis';
|
|
57
|
+
/**
|
|
58
|
+
* RESOLVE: apply every default and read both call-independent facts off the bound
|
|
59
|
+
* view, so the gate can judge exactly the figures the pipeline will run.
|
|
60
|
+
*
|
|
61
|
+
* A PURE function — no `Effect`, no context, no clock — which is what lets BOTH
|
|
62
|
+
* runner entry points share one resolution site. That is the whole reason it exists
|
|
63
|
+
* as a function rather than as a paragraph of `runProjection`'s body: the gate is
|
|
64
|
+
* only as good as the argument it is handed, and two resolution sites are free to
|
|
65
|
+
* drift into approving a figure the pipeline does not use. One site, and the figure
|
|
66
|
+
* that was judged cannot differ from the figure that runs, for one wiring and for N
|
|
67
|
+
* of them alike.
|
|
68
|
+
*
|
|
69
|
+
* The five `??` defaults are resolved HERE and ONCE. `batchSize` and `batchWindow`
|
|
70
|
+
* go into the pipeline, the three restart durations into the supervision options,
|
|
71
|
+
* where `superviseOnProgress` requires all three for exactly that reason.
|
|
72
|
+
*
|
|
73
|
+
* `maxNoProgressRestarts` is deliberately absent, as it is from the gate: it is
|
|
74
|
+
* BRANDED, so its boundary was the caller's own `.make(...)`, nothing here has to
|
|
75
|
+
* resolve it, and its default stays where its wall-clock arithmetic is documented.
|
|
76
|
+
*
|
|
77
|
+
* It takes the BOUND view rather than the unbound port because `key` and
|
|
78
|
+
* `viewDurability` are its two reads and both are on the bound façade. The UNBOUND
|
|
79
|
+
* store is still the only thing that can answer "are these two entries the same
|
|
80
|
+
* store?" — `forKey` deliberately does not expose what it closed over — so the gate
|
|
81
|
+
* takes that identity as a field of its own, from whichever caller holds one.
|
|
82
|
+
*/
|
|
83
|
+
const resolveProjection = (view, options) => ({
|
|
84
|
+
view,
|
|
85
|
+
key: view.key,
|
|
86
|
+
viewDurability: view.durability,
|
|
87
|
+
batchSize: options?.batchSize ?? DEFAULT_BATCH_SIZE,
|
|
88
|
+
batchWindow: options?.batchWindow ?? DEFAULT_BATCH_WINDOW,
|
|
89
|
+
restartMinDelay: options?.restartMinDelay ?? _superviseOnProgress.DEFAULT_RESTART_MIN_DELAY,
|
|
90
|
+
restartMaxDelay: options?.restartMaxDelay ?? _superviseOnProgress.DEFAULT_RESTART_MAX_DELAY,
|
|
91
|
+
restartResetAfter: options?.restartResetAfter ?? _superviseOnProgress.DEFAULT_RESTART_RESET_AFTER
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* A defect surfaced from the drain, converted into a value the supervisor can act
|
|
95
|
+
* on.
|
|
96
|
+
*
|
|
97
|
+
* **Why the conversion exists.** `DcbEventStore.subscribe` is `E = never` by
|
|
98
|
+
* contract (ADR-0002: infrastructure faults are defects, not channel values), so a
|
|
99
|
+
* store whose live tail fails beyond its own retry budget DIES rather than failing.
|
|
100
|
+
* Converting that death into a typed error at the runner's boundary is what makes
|
|
101
|
+
* it actionable: a defect can only be caught, whereas a value can be counted,
|
|
102
|
+
* logged, matched on, and fed to a supervisor that decides between backoff and
|
|
103
|
+
* give-up.
|
|
104
|
+
*
|
|
105
|
+
* **Why the boundary is DRAIN-WIDE**, which is what the name reports. The
|
|
106
|
+
* conversion sits outside the whole `runDrain`, so what arrives is a defect from
|
|
107
|
+
* any stage of it: the subscription's own death, the codec's decode, the read
|
|
108
|
+
* model's `apply`, or a `ProjectionStore` implementation that dies where the port
|
|
109
|
+
* says it should fail. They all end the run identically, and the progress-keyed
|
|
110
|
+
* breaker is the right arbiter for all of them, since it restarts while the
|
|
111
|
+
* checkpoint moves and gives up with a logged `ProjectionStalled` when it does
|
|
112
|
+
* not. Narrowing the conversion to the subscription stage would instead let an
|
|
113
|
+
* `apply` defect escape `Effect.retry` — which sees failures, never defects — and
|
|
114
|
+
* kill the daemon fibre outright: no restart, no `ProjectionStalled`, no logged
|
|
115
|
+
* give-up, and since `runProjection` is infallible, no route to an operator at
|
|
116
|
+
* all. The boundary must equally not WIDEN to `catchAllCause`; the comment at the
|
|
117
|
+
* conversion site sets out why.
|
|
118
|
+
*
|
|
119
|
+
* `defect` is `unknown` because it is somebody else's defect and the runner must
|
|
120
|
+
* not pretend to know its shape.
|
|
121
|
+
*/
|
|
122
|
+
exports.resolveProjection = resolveProjection;
|
|
123
|
+
class PipelineDied extends /*#__PURE__*/_effect.Data.TaggedError('PipelineDied') {
|
|
124
|
+
/**
|
|
125
|
+
* Why this class fills `message` at all: so the fault renders ITSELF.
|
|
126
|
+
*
|
|
127
|
+
* `Data.TaggedError` sets `name` to the tag and leaves `message` empty, so an
|
|
128
|
+
* unfilled tagged error stringifies to its bare tag — "the pipeline died", with
|
|
129
|
+
* no hint of what killed it, and `PipelineDied: ECONNRESET` is not the same log
|
|
130
|
+
* line. Filled, `Error.prototype.toString` yields `name: message`, so
|
|
131
|
+
* `String(fault)`, `Cause.pretty` (which reads `message` off anything
|
|
132
|
+
* `instanceof Error`) and every log line built from either report the field that
|
|
133
|
+
* says WHY — and no table of tag-to-label outside the class has to be kept in
|
|
134
|
+
* step with the fields inside it.
|
|
135
|
+
*
|
|
136
|
+
* `String(this.defect)` rather than anything cleverer, for exactly the reason
|
|
137
|
+
* `defect` is `unknown` above: plucking a `.message`, sniffing a `_tag` or
|
|
138
|
+
* `JSON.stringify`-ing it would each be the runner pretending to know the shape
|
|
139
|
+
* of somebody else's defect, and the last of them THROWS on a `bigint`.
|
|
140
|
+
*
|
|
141
|
+
* A GETTER rather than a `message` field, which keeps `defect` the single
|
|
142
|
+
* declaration of the fact. Why a prototype accessor is safe here, how far filling
|
|
143
|
+
* the field reaches and the structured `toJSON` shape it deliberately leaves
|
|
144
|
+
* untouched are set out once for all four of these getters on
|
|
145
|
+
* `ProjectionStoreError` in `ProjectionStore.ts`.
|
|
146
|
+
*/
|
|
147
|
+
get message() {
|
|
148
|
+
return String(this.defect);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* PREPARE: the whole middle of a projection call — the log's durability, the merged
|
|
153
|
+
* query, the construction gate's verdict and the decode stage — between the
|
|
154
|
+
* per-entry RESOLVE above and the per-entry BUILD below.
|
|
155
|
+
*
|
|
156
|
+
* ## Why it is a phase of its own
|
|
157
|
+
*
|
|
158
|
+
* Everything in it is a function of the CALL rather than of any one materialisation,
|
|
159
|
+
* and both entry points ran these same five steps in this same order before it
|
|
160
|
+
* existed. `runProjection` is the N = 1 case: it hands over a singleton entry list
|
|
161
|
+
* and its own preamble and gets back the pair `runProjections` gets back for N.
|
|
162
|
+
*
|
|
163
|
+
* ## What the ONE body is FOR: the gate is consulted before the codec
|
|
164
|
+
*
|
|
165
|
+
* This is worth more than the duplication it removes. `decodeSlices` refuses a slice
|
|
166
|
+
* record carrying two DISTINCT `Schema`s under one event type, and refuses it by
|
|
167
|
+
* THROWING — which inside this `Effect.gen` is a defect, exactly as the gate's
|
|
168
|
+
* verdict is. A record wrong in BOTH ways therefore has two sentences available and
|
|
169
|
+
* nothing but the ORDER of two statements decides which one its author reads. The
|
|
170
|
+
* gate's is the right one: it is the read side's own rule about the wiring in front
|
|
171
|
+
* of that author, where the codec's is about a merge the write path shares and
|
|
172
|
+
* `decode.ts` owns.
|
|
173
|
+
*
|
|
174
|
+
* That order is now a property of ONE body — the gate call above, the `decodeSlices`
|
|
175
|
+
* call below — for both entry points at once. It used to be a claim two function
|
|
176
|
+
* bodies each made in prose, free to drift, and pinned for only one of them. It is
|
|
177
|
+
* pinned for both now: `test/runProjections.test.ts`'s "the GATE is consulted before
|
|
178
|
+
* the codec" case and `test/runner.construction.test.ts`'s sibling each drive a
|
|
179
|
+
* record breaking both rules and assert which sentence comes back. Neither RULE is
|
|
180
|
+
* under test in either — `packages/codec`'s decode suite and
|
|
181
|
+
* `projectionWiringFault.test.ts` own those.
|
|
182
|
+
*
|
|
183
|
+
* ## What the caller keeps
|
|
184
|
+
*
|
|
185
|
+
* The PREAMBLE, and only the preamble: `runProjection` names the projection and its
|
|
186
|
+
* partition, `runProjections` the projection alone, and this function joins whichever
|
|
187
|
+
* it was to the gate's sentence about the RULE with one `': '`. That is the division
|
|
188
|
+
* `projectionWiringFault`'s doc fixes — the gate knows the rule, the entry point
|
|
189
|
+
* knows whose wiring it is — and moving the single `Effect.die` here changes only
|
|
190
|
+
* WHERE the two halves meet, never which half writes which. It is built eagerly, one
|
|
191
|
+
* interpolation per construction, rather than as a thunk: a call that is about to
|
|
192
|
+
* subscribe to an event log does not need that deferred, and a thunk reads worse at
|
|
193
|
+
* both call sites.
|
|
194
|
+
*
|
|
195
|
+
* ## Why both derivations happen HERE
|
|
196
|
+
*
|
|
197
|
+
* The runner needs only the merged QUERY from the composition — the fold is the read
|
|
198
|
+
* model's own `apply` — but it must be the SAME merge a fold would use, so it comes
|
|
199
|
+
* from `core`'s `composeProjections` rather than a local query union that could drift
|
|
200
|
+
* from it. It is also the gate's input, and the gate can only judge it at
|
|
201
|
+
* construction because the union is a pure function of the slices.
|
|
202
|
+
*
|
|
203
|
+
* Both derivations run ONCE per call rather than once per entry or once per restart,
|
|
204
|
+
* so N subscriptions share a single `Query` object and N pipelines a single merged
|
|
205
|
+
* `type -> Schema` table. Sharing the decode stage is safe because the `Serializer`
|
|
206
|
+
* is read from context INSIDE it, per stream, so one stage does not freeze one
|
|
207
|
+
* serialiser across entries. `DecodeStage`'s own doc says which references to that
|
|
208
|
+
* alias hold the inference up, and which do not.
|
|
209
|
+
*
|
|
210
|
+
* The cast erases each slice's own state and event types down to `AnyProjection`. It
|
|
211
|
+
* is sound because `composeProjections` only ever folds a slice through its OWN
|
|
212
|
+
* `evolve`, never across two, so the per-slice pairing the erasure hides is the one
|
|
213
|
+
* thing it cannot violate — and `T`'s precise shape is recovered on the way out, in
|
|
214
|
+
* `CompositeState<T>`. It is unavoidable rather than merely convenient: a slice
|
|
215
|
+
* record is keyed by a caller's literal union, and no signature in `core` is generic
|
|
216
|
+
* over that union AND over each member's state, so the variance has to be discharged
|
|
217
|
+
* somewhere. Once, now, rather than at each entry point.
|
|
218
|
+
*
|
|
219
|
+
* ## Why `EventLogDurability` is read from CONTEXT here
|
|
220
|
+
*
|
|
221
|
+
* Because it is R2's log half, and one log is ONE fact —
|
|
222
|
+
* `EventLogDurability.ts` argues why it is a service declared beside the store layer
|
|
223
|
+
* rather than a field per read model. Reading it once for the CALL is what that
|
|
224
|
+
* argument already wanted, and it is deliberately not part of `resolveProjection`,
|
|
225
|
+
* which is per ENTRY and pure. It is this function's only requirement, and through it
|
|
226
|
+
* the reason both entry points declare one.
|
|
227
|
+
*/
|
|
228
|
+
exports.PipelineDied = PipelineDied;
|
|
229
|
+
const prepareProjection = (slices, materialisations, preamble) => _effect.Effect.gen(function* () {
|
|
230
|
+
// The LOG's half of R2, from CONTEXT rather than from any read model. Each
|
|
231
|
+
// entry's VIEW half already rode in on the resolved wiring.
|
|
232
|
+
const eventLogDurability = yield* _EventLogDurability.EventLogDurability;
|
|
233
|
+
const composite = (0, _core.composeProjections)(slices);
|
|
234
|
+
// ## ASSERT — one gate, one verdict, one `Effect.die`
|
|
235
|
+
//
|
|
236
|
+
// Five rules over four vocabularies, in the order `projectionWiringFault`
|
|
237
|
+
// declares and argues; this function supplies the values and classifies the
|
|
238
|
+
// verdict, and its caller supplied the preamble that says WHOSE wiring is wrong.
|
|
239
|
+
// Both entry points reach this before they fork anything, so a rejected wiring
|
|
240
|
+
// has read no checkpoint and opened no subscription.
|
|
241
|
+
const fault = (0, _projectionWiringFault.projectionWiringFault)({
|
|
242
|
+
eventLogDurability,
|
|
243
|
+
query: composite.query,
|
|
244
|
+
slices,
|
|
245
|
+
materialisations
|
|
246
|
+
});
|
|
247
|
+
if (fault !== undefined) {
|
|
248
|
+
return yield* _effect.Effect.die(new Error(`${preamble}: ${fault}`));
|
|
249
|
+
}
|
|
250
|
+
// BELOW the gate, and that is the ordering this phase exists to own.
|
|
251
|
+
// `decodeSlices` carries the CODEC's own construction refusal — two DISTINCT
|
|
252
|
+
// `Schema`s under one event type — and it THROWS, which here is a second defect;
|
|
253
|
+
// a record wrong in both ways must meet the gate's sentence first. Moving this
|
|
254
|
+
// call above the gate would still die with nothing forked, only with the wrong
|
|
255
|
+
// sentence, which is why the doc above names the two suites that pin it.
|
|
256
|
+
//
|
|
257
|
+
// It takes the RECORD rather than a pre-merged schema table for the same reason
|
|
258
|
+
// the query is composed here: the decode lookup and the subscription query
|
|
259
|
+
// cannot then come from different records.
|
|
260
|
+
const decode = (0, _codec.decodeSlices)(slices);
|
|
261
|
+
return {
|
|
262
|
+
query: composite.query,
|
|
263
|
+
decode
|
|
264
|
+
};
|
|
265
|
+
});
|
|
266
|
+
/**
|
|
267
|
+
* BUILD and FORK: one resolved wiring plus the three shared derivations in, one
|
|
268
|
+
* supervised daemon out.
|
|
269
|
+
*
|
|
270
|
+
* This is everything the two runner entry points have in common from the gate's
|
|
271
|
+
* verdict onwards — the subscription, the decode, the micro-batching, the guarded
|
|
272
|
+
* commit, the supervisor and the `forkScoped`. It is package-internal and takes no
|
|
273
|
+
* `ReadModel`, so `runProjections` reaches it directly rather than by re-entering
|
|
274
|
+
* `runProjection` per entry, which is what lets one call resolve, judge and derive
|
|
275
|
+
* ONCE and still run N identical pipelines. `read-postgres`'s
|
|
276
|
+
* `test/courseRosterGraduation.test.ts` rests on the two callers running literally
|
|
277
|
+
* the same pipeline, so this function staying the only build step is load-bearing.
|
|
278
|
+
*
|
|
279
|
+
* It requires no `EventLogDurability`. That service is read by `prepareProjection`
|
|
280
|
+
* above — the one place it is read at all — for the gate, and has no part in what
|
|
281
|
+
* runs; the two public entry points DECLARE it only because they run that phase.
|
|
282
|
+
*
|
|
283
|
+
* `query` and `decode` arrive as ARGUMENTS rather than being derived here from a
|
|
284
|
+
* slice record, which is a structural gain rather than a cost: the build step holds
|
|
285
|
+
* no slice record at all, so there is no second record it could derive a different
|
|
286
|
+
* query or a different decode table from. It is the same move `decodeSlices` itself
|
|
287
|
+
* made when it collapsed a two-step protocol into one call.
|
|
288
|
+
*/
|
|
289
|
+
exports.prepareProjection = prepareProjection;
|
|
290
|
+
const buildAndFork = (resolved, build) => _effect.Effect.gen(function* () {
|
|
291
|
+
const {
|
|
292
|
+
view,
|
|
293
|
+
key,
|
|
294
|
+
batchSize,
|
|
295
|
+
batchWindow,
|
|
296
|
+
restartMinDelay,
|
|
297
|
+
restartMaxDelay,
|
|
298
|
+
restartResetAfter
|
|
299
|
+
} = resolved;
|
|
300
|
+
const store = yield* _core.DcbEventStore;
|
|
301
|
+
/**
|
|
302
|
+
* One run of the pipeline: resolve the resume point, subscribe from it, and
|
|
303
|
+
* drain until the stream ends, is interrupted, or dies.
|
|
304
|
+
*
|
|
305
|
+
* `Effect.scoped` per RUN, not per runner, so a restart releases the previous
|
|
306
|
+
* subscription's resources (the store's listener, its poll fibre) before the
|
|
307
|
+
* next one acquires them — otherwise every restart would leak a subscription
|
|
308
|
+
* into the runner's outer scope.
|
|
309
|
+
*/
|
|
310
|
+
const runOnce = _effect.Effect.gen(function* () {
|
|
311
|
+
// Re-read on EVERY attempt. This is the resynchronisation: after a lost
|
|
312
|
+
// checkpoint guard the stored position is whatever the winner advanced it
|
|
313
|
+
// to, and the restart picks that up instead of resuming from a stale
|
|
314
|
+
// expectation.
|
|
315
|
+
const stored = yield* view.readCheckpoint;
|
|
316
|
+
// The expectation for the next guarded advance, threaded through the run.
|
|
317
|
+
// A `Ref` rather than a fold accumulator because the batch committer is a
|
|
318
|
+
// `Stream.mapEffect` callback; correctness rests on the single-writer
|
|
319
|
+
// property (concurrency 1), so there is exactly one fibre reading and
|
|
320
|
+
// writing this.
|
|
321
|
+
const expected = yield* _effect.Ref.make(stored);
|
|
322
|
+
const commitBatch = batch => _effect.Effect.gen(function* () {
|
|
323
|
+
const events = _effect.Chunk.toReadonlyArray(batch);
|
|
324
|
+
// Total on the empty chunk. `groupedWithin` is `aggregateWithin` over a
|
|
325
|
+
// `collectAllN` sink on a `spaced` schedule, so a window that elapses
|
|
326
|
+
// with nothing buffered has an empty collection to emit; even if a
|
|
327
|
+
// given version suppressed that, resting the runner's correctness on an
|
|
328
|
+
// undocumented internal would be a bug waiting for an upgrade. There is
|
|
329
|
+
// nothing to apply and no last position, and committing `expected` onto
|
|
330
|
+
// itself would be a pointless write that could lose its guard to a
|
|
331
|
+
// legitimate winner and restart the pipeline for nothing.
|
|
332
|
+
if (!_effect.Array.isNonEmptyReadonlyArray(events)) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
// The last event's position, AS IS. Never `expected + 1` and never any
|
|
336
|
+
// other arithmetic: positions are strictly increasing but NOT gapless
|
|
337
|
+
// (a rolled-back append burns ids), so the gap between two delivered
|
|
338
|
+
// events is normal and an increment would invent a position that either
|
|
339
|
+
// never existed or belongs to an event this query does not match.
|
|
340
|
+
const next = _effect.Array.lastNonEmpty(events).sequenced.position;
|
|
341
|
+
const from = yield* _effect.Ref.get(expected);
|
|
342
|
+
// The port owns the bracket: the view writes go IN, so the checkpoint
|
|
343
|
+
// advance cannot happen outside the transaction that carries them. A
|
|
344
|
+
// lost guard fails here, which aborts the whole commit and restarts the
|
|
345
|
+
// run — `expected` is deliberately NOT advanced on a failure. There is
|
|
346
|
+
// no `key` argument: the store is bound to one, so the batch cannot be
|
|
347
|
+
// committed against a cursor other than the one it was read from.
|
|
348
|
+
yield* view.commit({
|
|
349
|
+
expected: from,
|
|
350
|
+
next,
|
|
351
|
+
viewWrites: build.apply(events)
|
|
352
|
+
});
|
|
353
|
+
yield* _effect.Ref.set(expected, next);
|
|
354
|
+
});
|
|
355
|
+
yield* store.subscribe(build.query, stored).pipe(build.decode, _effect.Stream.groupedWithin(batchSize, batchWindow), _effect.Stream.mapEffect(commitBatch, {
|
|
356
|
+
concurrency: 1
|
|
357
|
+
}), _effect.Stream.runDrain,
|
|
358
|
+
// `catchAllDefect`, NOT `catchAllCause`. The subscription's failure mode
|
|
359
|
+
// is a DEFECT (`subscribe` is `E = never`) and that is what the
|
|
360
|
+
// supervisor needs as a value — but the OTHER way this drain ends is
|
|
361
|
+
// INTERRUPTION, when the enclosing `Scope` closes at shutdown.
|
|
362
|
+
// `catchAllCause` would swallow that too, turning a graceful teardown
|
|
363
|
+
// into a `PipelineDied` that the supervisor would dutifully retry —
|
|
364
|
+
// restarting a subscription inside a scope that is being torn down.
|
|
365
|
+
// `catchAllDefect` re-fails any cause carrying no defect, so interruption
|
|
366
|
+
// propagates untouched and the fibre dies when it is told to.
|
|
367
|
+
//
|
|
368
|
+
// Placed outside the WHOLE drain, so it converts a defect from any stage
|
|
369
|
+
// — decode, `apply`, a store implementation that dies — and not only the
|
|
370
|
+
// subscription's own death; the fault says PIPELINE for that reason.
|
|
371
|
+
// `PipelineDied`'s doc carries the reasoning (in short: they all end the
|
|
372
|
+
// run identically, and a narrower conversion would let an `apply` defect
|
|
373
|
+
// bypass the supervisor entirely).
|
|
374
|
+
_effect.Effect.catchAllDefect(defect => new PipelineDied({
|
|
375
|
+
key,
|
|
376
|
+
defect
|
|
377
|
+
})));
|
|
378
|
+
}).pipe(_effect.Effect.scoped);
|
|
379
|
+
// ## SUPERVISE — one attempt in, a supervised daemon out
|
|
380
|
+
//
|
|
381
|
+
// What goes with it is the whole of what supervision knows about this runner:
|
|
382
|
+
// the key it reports under, the bound store's `readCheckpoint` as the progress
|
|
383
|
+
// signal, whatever the caller wrote in the UNRESOLVED half of its supervision
|
|
384
|
+
// options, and the three restart durations RESOLVED above.
|
|
385
|
+
//
|
|
386
|
+
// What DOES the work is that those three were resolved ONCE, in
|
|
387
|
+
// `resolveProjection`, so the supervisor receives exactly the figures the gate
|
|
388
|
+
// judged — the argument is on `SuperviseOnProgressOptions` in
|
|
389
|
+
// `superviseOnProgress.ts`, which requires all three for exactly that reason.
|
|
390
|
+
//
|
|
391
|
+
// WHICH FIELDS travel is carried by the TYPES, not by an enumeration of the
|
|
392
|
+
// forwardable ones. `UnresolvedSupervisionOptions` — the type
|
|
393
|
+
// `SuperviseOnProgressOptions` is built from — is `ProjectionSupervisionOptions`
|
|
394
|
+
// MINUS the resolved three, so a new OPTIONAL supervision field lands in it and
|
|
395
|
+
// travels through this call with no edit here, while a new RESOLVED figure lands
|
|
396
|
+
// in `ResolvedSupervisionTuning` instead and leaves the literal below missing a
|
|
397
|
+
// required property. Neither direction rests on a comment or on a test
|
|
398
|
+
// remembering to be extended, which is what the enumeration this replaced could
|
|
399
|
+
// not say.
|
|
400
|
+
//
|
|
401
|
+
// The REST-DESTRUCTURE is the other half, and it is about the OBJECT rather than
|
|
402
|
+
// its type. `build.options` is the caller's own FLAT record, so a raw
|
|
403
|
+
// `restartMinDelay` it wrote is copied by a spread whatever the spread's static
|
|
404
|
+
// type says it holds; discarded here, it is not in the object to be copied at
|
|
405
|
+
// all. Without it the resolved figure would stay on top only while it was written
|
|
406
|
+
// LAST in the literal, and a transposition of two adjacent lines would typecheck
|
|
407
|
+
// and then run the unjudged figure — a rule that has to be remembered is one an
|
|
408
|
+
// edit reading as pure tidying can break.
|
|
409
|
+
//
|
|
410
|
+
// The three discards are the one place a resolved field is named twice, and they
|
|
411
|
+
// cannot silently fall out of step: a fourth resolved figure stops the literal
|
|
412
|
+
// below compiling until it is named there, and its author is then one line from
|
|
413
|
+
// this destructure.
|
|
414
|
+
//
|
|
415
|
+
// The caller's two PIPELINE figures ride along in the copy and are inert: the
|
|
416
|
+
// supervisor reads its options by name and has no field either could reach.
|
|
417
|
+
// Excluding them would be two more discards for nothing.
|
|
418
|
+
//
|
|
419
|
+
// What is destructured is the OPTIONS and not `resolved`: that record is flat and
|
|
420
|
+
// also carries `view`, `viewDurability`, `batchSize` and `batchWindow`, so
|
|
421
|
+
// spreading it wholesale would ride four dead fields into a supervisor's options
|
|
422
|
+
// object — the hazard `runProjections.ts` names where it builds its entry literal
|
|
423
|
+
// explicitly.
|
|
424
|
+
//
|
|
425
|
+
// `?? {}` rather than the conditional spreads this replaced.
|
|
426
|
+
// `exactOptionalPropertyTypes` bars setting an optional key to an explicit
|
|
427
|
+
// `undefined`, and this sets none: spreading an object contributes only the keys
|
|
428
|
+
// it has, and an absent whole options object contributes none at all.
|
|
429
|
+
//
|
|
430
|
+
// The progress signal goes in as a VALUE, so nothing has been read from the
|
|
431
|
+
// view store yet: a runner rejected above still has not touched it.
|
|
432
|
+
//
|
|
433
|
+
// Nothing is handed in for RENDERING the runner's faults on the supervisor's
|
|
434
|
+
// log lines. All four set `message`, so `String(fault)` is
|
|
435
|
+
// `Error.prototype.toString` — `'ProjectionStoreError: ECONNRESET'` — and each
|
|
436
|
+
// fault labels itself wherever it is reported, from the field that says why.
|
|
437
|
+
// `CheckpointSuperseded`'s is the interesting one and its own doc carries the
|
|
438
|
+
// argument: its `expected` is a `bigint`, but a `bigint` interpolated into a
|
|
439
|
+
// `string` is digits, so the value class the log reduction below keeps away from
|
|
440
|
+
// a serialiser never reaches one through `message`.
|
|
441
|
+
//
|
|
442
|
+
// The residual error is `ProjectionStalled` and nothing else: the schedule
|
|
443
|
+
// never terminates on its own, so the only way out with a failure is the
|
|
444
|
+
// breaker giving up. `superviseOnProgress` carries that reasoning.
|
|
445
|
+
const {
|
|
446
|
+
restartMinDelay: _rawMinDelay,
|
|
447
|
+
restartMaxDelay: _rawMaxDelay,
|
|
448
|
+
restartResetAfter: _rawResetAfter,
|
|
449
|
+
...supervisionOverrides
|
|
450
|
+
} = build.options ?? {};
|
|
451
|
+
const daemon = (0, _superviseOnProgress.superviseOnProgress)(runOnce, {
|
|
452
|
+
key,
|
|
453
|
+
progress: view.readCheckpoint,
|
|
454
|
+
...supervisionOverrides,
|
|
455
|
+
restartMinDelay,
|
|
456
|
+
restartMaxDelay,
|
|
457
|
+
restartResetAfter
|
|
458
|
+
});
|
|
459
|
+
// ## FORK
|
|
460
|
+
//
|
|
461
|
+
// `forkScoped`, so the daemon's lifetime IS the caller's scope: no manual
|
|
462
|
+
// shutdown handle to forget, and scope close interrupts and awaits the fibre
|
|
463
|
+
// deterministically. A plain `Effect.fork` would tie it to the calling
|
|
464
|
+
// fibre's lifetime, which for a wiring effect that returns immediately would
|
|
465
|
+
// kill the daemon on the spot.
|
|
466
|
+
const fibre = yield* _effect.Effect.forkScoped(daemon);
|
|
467
|
+
// The BOUND view goes back with the fibre, which is what lets a returned handle
|
|
468
|
+
// name its own cursor. It is the same object the pipeline above commits through,
|
|
469
|
+
// not a re-binding: `runProjections` resolved it from a store its caller never
|
|
470
|
+
// bound, and equal keys across N entries leave it as the only discriminator.
|
|
471
|
+
return {
|
|
472
|
+
key,
|
|
473
|
+
store: view,
|
|
474
|
+
fibre
|
|
475
|
+
};
|
|
476
|
+
});
|
|
477
|
+
exports.buildAndFork = buildAndFork;
|
|
478
|
+
//# sourceMappingURL=ProjectionRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectionRunner.js","names":["_codec","require","_core","_effect","_EventLogDurability","_projectionWiringFault","_superviseOnProgress","BatchSize","exports","Schema","Int","pipe","positive","brand","DEFAULT_BATCH_SIZE","make","DEFAULT_BATCH_WINDOW","resolveProjection","view","options","key","viewDurability","durability","batchSize","batchWindow","restartMinDelay","DEFAULT_RESTART_MIN_DELAY","restartMaxDelay","DEFAULT_RESTART_MAX_DELAY","restartResetAfter","DEFAULT_RESTART_RESET_AFTER","PipelineDied","Data","TaggedError","message","String","defect","prepareProjection","slices","materialisations","preamble","Effect","gen","eventLogDurability","EventLogDurability","composite","composeProjections","fault","projectionWiringFault","query","undefined","die","Error","decode","decodeSlices","buildAndFork","resolved","build","store","DcbEventStore","runOnce","stored","readCheckpoint","expected","Ref","commitBatch","batch","events","Chunk","toReadonlyArray","Arr","isNonEmptyReadonlyArray","next","lastNonEmpty","sequenced","position","from","get","commit","viewWrites","apply","set","subscribe","Stream","groupedWithin","mapEffect","concurrency","runDrain","catchAllDefect","scoped","_rawMinDelay","_rawMaxDelay","_rawResetAfter","supervisionOverrides","daemon","superviseOnProgress","progress","fibre","forkScoped"],"sources":["../../src/ProjectionRunner.ts"],"sourcesContent":[null],"mappings":";;;;;;AAqFA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AAYA,IAAAG,mBAAA,GAAAH,OAAA;AAQA,IAAAI,sBAAA,GAAAJ,OAAA;AAIA,IAAAK,oBAAA,GAAAL,OAAA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMM,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAGE,cAAM,CAACC,GAAG,CAACC,IAAI,cACtCF,cAAM,CAACG,QAAQ,EAAE,eACjBH,cAAM,CAACI,KAAK,CAAC,WAAW,CAAC,CAC1B;AAGD;;;;;AAKA,MAAMC,kBAAkB,gBAAcP,SAAS,CAACQ,IAAI,CAAC,GAAG,CAAC;A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EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM;IACJhE,eAAe,EAAEiE,YAAY;IAC7B/D,eAAe,EAAEgE,YAAY;IAC7B9D,iBAAiB,EAAE+D,cAAc;IACjC,GAAGC;EAAoB,CACxB,GAA4BpC,KAAK,CAACtC,OAAO,IAAI,EAAE;EAEhD,MAAM2E,MAAM,GAIR,IAAAC,wCAAmB,EAACnC,OAAO,EAAE;IAC/BxC,GAAG;IACH4E,QAAQ,EAAE9E,IAAI,CAAC4C,cAAc;IAC7B,GAAG+B,oBAAoB;IACvBpE,eAAe;IACfE,eAAe;IACfE;GACD,CAAC;EAEF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMoE,KAAK,GAAG,OAAOxD,cAAM,CAACyD,UAAU,CAACJ,MAAM,CAAC;EAE9C;EACA;EACA;EACA;EACA,OAAO;IAAE1E,GAAG;IAAEsC,KAAK,EAAExC,IAAI;IAAE+E;EAAK,CAAE;AACpC,CAAC,CAAC;AAAAzF,OAAA,CAAA+C,YAAA,GAAAA,YAAA","ignoreList":[]}
|