Skip to main content

Module reactive

Module reactive 

Source
Expand description

Reactive data structures — Core-level integration (M5.A — D177/D179).

Each structure wraps a backend trait behind a parking_lot::Mutex, owns a state NodeId registered with Core, and emits DIRTY->DATA snapshots on every mutation. Structures are standalone — no Graph dependency required.

Lock discipline (P1 fix): Mutation methods hold the inner lock only during backend mutation and snapshot collection. The lock is dropped before Core::emit() is called, so subscribers are free to read (but not mutate) the structure during message delivery. The EmitHandle lives outside the inner Mutex and uses AtomicU64 for thread-safe version counting.

Structs§

AttachOptions
D270 — AttachOptions { skip_cached_replay } (memo:Re P2 parity). Mirrors TS ReactiveLogBundle.attach(upstream, opts?): when skip_cached_replay = true AND the upstream has a cached value (Core::cache_of(upstream) non-sentinel), drop the FIRST DATA- bearing batch the attach sink receives — i.e. the subscribe- handshake replay. Subsequent live emissions still land. A cold upstream’s first live emit is NOT dropped (the cache_of check gates the suppression). The flag has no effect when the upstream’s cache is sentinel (no replay to skip).
AttachStorageHandle
Handle to an attach-storage subscription. Call AttachStorageHandle::detach to dispose it (no RAII — D246 r3).
IndexOutOfBounds
Error returned when a list insert or insert_many index is out of bounds.
LogView
Handle to a log view. Call LogView::detach to dispose the view subscription (no RAII — D246 r3).
MapConfigError
Configuration validation error for ReactiveMap.
ReactiveIndex
Reactive sorted index with primary key lookup and secondary sort order.
ReactiveIndexOptions
Options for constructing a ReactiveIndex.
ReactiveList
Reactive ordered list.
ReactiveListOptions
Options for constructing a ReactiveList.
ReactiveLog
Reactive append-only log with optional ring-buffer cap.
ReactiveLogOptions
Options for constructing a ReactiveLog.
ReactiveMap
Reactive key-value map.
ReactiveMapOptions
Options for constructing a ReactiveMap.
ReactiveSub
D246 rule 3: NO RAII unsubscribe below the binding. A subscription bundle that tracks its (NodeId, SubscriptionId) subs and is torn down by the owner-invoked, synchronous ReactiveSub::detach — not Drop. Carries no &Core (the 'c lifetime is gone); the owner passes its &Core into detach.
RetentionPolicy
Score-based retention policy for ReactiveMap.
ScanHandle
Handle to a log scan. Call ScanHandle::detach to dispose the scan subscription (no RAII — D246 r3).
UpsertOptions
Per-call upsert options for ReactiveIndex::upsert.

Enums§

ViewSpec
View specification for ReactiveLog::view.

Traits§

AppendLogSink
Trait for append-log storage sinks used by ReactiveLog::attach_storage.

Type Aliases§

IndexEqualsFn
User-supplied equality function for upsert idempotency.
InternFn
User-supplied function that converts a snapshot value Vec<T> (or similar) into a HandleId for Core emission. The binding owns the value registry; this closure captures Arc<Binding> and calls binding.intern(snapshot).