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

    Class LivePartitionedView<SBase, R, K>

    Chained typed view over a LivePartitionedSeries. Returned by every sugar method on the root partitioned series and on this view, composing the operator factory at each step.

    The view is lazy: factories aren't run until a terminal (collect(), apply(), toMap()) is called. Each terminal delegates back to the root's per-partition state, applying the composed factory chain to each partition's LiveSeries.

    Lifecycle. All real state lives on the root LivePartitionedSeries — chained views are just deferred factories that point back at the root. They don't register their own subscriptions on the source. Disposing the root disposes everything: terminals subscribed to factory outputs are tracked on the root's internal disposers, including outputs created by view.toMap().

    const cpuSmoothed = live
    .partitionBy('host')
    .fill({ cpu: 'hold' }) // → LivePartitionedView<S, S, K>
    .rolling('1m', { cpu: 'avg' }) // → LivePartitionedView<S, R, K>
    .collect(); // → LiveSeries<R>

    Type Parameters

    • SBase extends SeriesSchema

      schema of the root partitioned series's per-partition LiveSeries (kept so the composed factory's input type is correct).

    • R extends SeriesSchema

      schema of the current chained output.

    • K extends string = string

      partition key type.

    Index

    Constructors

    Properties

    schema: R

    Schema of the chained output. Captured by running the factory once on a stub LiveSeries<SBase> at construction.

    Methods

    • Type Parameters

      • const Targets extends string

      Parameters

      • spec: {
            [P in string]:
                | "sum"
                | "count"
                | "min"
                | "max"
                | ((acc: number, value: number) => number)
        }

      Returns LivePartitionedView<
          SBase,
          readonly [R[0], ReplaceSmoothedColumn<ValueColumnsForSchema<R>, Targets>],
          K,
      >

    • Materialize the chained view per-partition as a Map<K, LiveSource<R>>. Runs the composed factory once per existing partition; auto-spawn from the root partitioned series is not propagated into this map (the snapshot reflects partitions at the time of the call).

      Each factory output (a LiveView / LiveRollingAggregation / etc.) holds an internal subscription to its source. To avoid accumulating listeners across repeated calls, every factory output's dispose() is registered on the root's disposer set — calling partitioned.dispose() on the root cleans up every toMap-created subscription chain.

      For a live-updating per-partition view, subscribe to the root partitionBy directly with toMap() and call the factory yourself, or use collect() for a unified buffer.

      Returns Map<K, LiveSource<R>>