Documentation
¶
Overview ¶
Package visibility maintains the eventually-consistent status/flow indexes (spec §9). An Indexer durably consumes the packtrail-events stream and projects each domain event into the packtrail-idx-status and packtrail-idx-flow KV buckets, idempotently and per-revision: an event is applied only if its execution revision is newer than the one already indexed, so duplicate or out-of-order deliveries — and multiple indexer instances on the same durable — are safe.
A periodic Reconcile authoritatively rebuilds the indexes from the source of truth (packtrail-executions), closing any residual drift. The indexes are best-effort: use them for dashboards and operational search, never for correctness decisions (for those, read packtrail-executions directly).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer projects domain events into the visibility indexes and answers lookups by status and by flow.
func New ¶
New returns an Indexer backed by the store's JetStream context, index buckets and namespace.
func (*Indexer) Reconcile ¶
Reconcile rebuilds the indexes from the source of truth, closing any drift the asynchronous projection may have left behind (spec §9). It scans packtrail-executions and authoritatively re-asserts each execution's membership.
Per §13 this full scan is the part that does not scale to high volumes; the suggested mitigation is to scope the scan to still-active executions and/or archive terminal executions out of the hot bucket.
func (*Indexer) Run ¶
Run starts the durable consumer on packtrail-events and projects every event until ctx is cancelled. The returned ConsumeContext must be stopped by the caller. DeliverAll lets a fresh or restarted indexer catch up from the start of the stream; projection is idempotent so replays are harmless.