refactor(api): remove watermark sync surface
This commit is contained in:
parent
4cee5bd824
commit
ff499c3603
25 changed files with 141 additions and 392 deletions
|
|
@ -19,37 +19,3 @@ export const Synced = Schema.Struct({
|
|||
"Marker emitted once when a log read reaches its captured watermark. The reader holds every event committed at or below seq.",
|
||||
})
|
||||
export interface Synced extends Schema.Schema.Type<typeof Synced> {}
|
||||
|
||||
/**
|
||||
* A payload-free doorbell: the aggregate's log advanced to at least `seq`.
|
||||
* Hints are a latency optimization only; no consumer may derive correctness
|
||||
* from receiving one. Correctness always comes from a durable log read plus
|
||||
* the consumer's own checkpoint.
|
||||
*/
|
||||
export const Hint = Schema.Struct({
|
||||
type: Schema.Literal("log.hint"),
|
||||
aggregateID: Schema.String,
|
||||
seq: Event.Seq,
|
||||
}).annotate({
|
||||
identifier: "EventLog.Hint",
|
||||
description:
|
||||
"Payload-free change hint: the aggregate's durable log advanced to at least seq. Hints coalesce under backpressure (latest per aggregate) and are never a delivery guarantee.",
|
||||
})
|
||||
export interface Hint extends Schema.Schema.Type<typeof Hint> {}
|
||||
|
||||
/**
|
||||
* Hints may have been lost. Treat every aggregate as potentially dirty and
|
||||
* recover via bounded sweep plus durable log reads. Also emitted first on
|
||||
* every (re)subscribe, since hints during disconnection were never buffered.
|
||||
*/
|
||||
export const SweepRequired = Schema.Struct({
|
||||
type: Schema.Literal("log.sweep_required"),
|
||||
}).annotate({
|
||||
identifier: "EventLog.SweepRequired",
|
||||
description:
|
||||
"Hints may have been lost; treat every aggregate as potentially dirty and recover via bounded sweep plus durable log reads. Emitted first on every (re)subscribe.",
|
||||
})
|
||||
export interface SweepRequired extends Schema.Schema.Type<typeof SweepRequired> {}
|
||||
|
||||
export const Change = Schema.Union([Hint, SweepRequired]).annotate({ identifier: "EventLog.Change" })
|
||||
export type Change = typeof Change.Type
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export type ID = typeof ID.Type
|
|||
|
||||
/**
|
||||
* Position in one aggregate's durable log. Values originate from the durable
|
||||
* event envelope, synced markers, change hints, and snapshot watermarks;
|
||||
* event envelope and synced markers;
|
||||
* `after` cursors accept only values that came from those sources.
|
||||
*/
|
||||
export const Seq = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("Event.Seq"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue