pond-ts API Reference (core)
    Preparing search index...

    Class LiveFusedRolling<S, Out>

    Multi-window rolling that maintains N windows in one ingest pass over a single shared deque. Replaces the workaround of multiple separate LiveRollingAggregations sharing the same source — the gRPC experiment's V6→V7 profile-diff (PR #19) showed every per- event pond hop roughly doubled when running two rollings.

    Each declared window has:

    • Its own resolved duration (clipped to retention; see PLAN.md)
    • Its own column-spec list and reducer states
    • Its own head cursor into the shared deque

    Output is ONE merged stream: one event per trigger boundary, with all windows' columns concatenated into one record. Duplicate output column names across windows are rejected at construction with a clear error (compile-time detection is queued as a follow-up).

    Single trigger. All windows share the configured trigger. Per-window cadence is explicitly NOT supported — that's what fusion saves. Users who need per-window cadence fall back to two separate rolling() calls and pay the V7 cost.

    Time-based windows only. Object keys are duration strings. Count-based windows stay on the existing single-window LiveRollingAggregation. This constraint keeps the window-clip-to-retention rule and boundary-detection logic clean.

    Public API: constructed via the live.rolling(fusedMapping, opts) keyed-form overload on LiveSeries / LiveView. User code doesn't import this class directly.

    Type Parameters

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    name: string
    schema: Out

    Accessors

    Methods

    • Pipeline stats snapshot — cumulative counters since construction plus current shared-deque state. Cheap O(1).

      • eventsObserved: total source events ingested. Includes events replayed at construction from a non-empty source. Never decreases.
      • evictions: total events that have aged out of every declared window (= shared-deque front advances). Each value counts a single source event, regardless of how many per-window remove calls it triggered. Never decreases.
      • emissions: total merged output events fired. Never decreases. For Trigger.event it equals eventsObserved; for Trigger.count(n) and Trigger.clock it can be smaller.
      • windowSize: current live size of the shared deque (= max across all windows' live counts). Use LiveFusedRolling.value for per-window snapshots. Note: the partitioned variant LivePartitionedSyncRolling.stats also has a windowSize field, but it means "max across partitions" rather than "max across windows." Different axis, same name.
      • windowsCount: number of declared windows. Static after construction.

      Returns {
          emissions: number;
          eventsObserved: number;
          evictions: number;
          windowsCount: number;
          windowSize: number;
      }

    • Read the current merged snapshot — every window's reducer outputs concatenated into one record. Useful for live-display patterns where the consumer wants the latest values without waiting for the next trigger fire.

      Returns Record<string, ColumnValue | undefined>