@pond-ts/process API Reference
    Preparing search index...

    Class Host

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Parameters

      • options: {
            budgetBytes?: number;
            maxSources?: number;
            registry: Registry;
            sources?: SourceRegistry;
            units?: Readonly<Record<string, string>>;
        }
        • OptionalbudgetBytes?: number

          Cap on retained node values per bound graph, in bytes — see bind. Without one, a host accepting runtime plans retains every distinct spec ever asked of every dataset, so memory scales with questions asked rather than with anything bounded. A host whose plans arrive from callers it does not control should set this.

          What bounds the number of graphs is a separate question with two answers. Datasets registered with add are the host author's own, bounded by what the author adds and released with remove. Sources resolved through a source registry by runAsync are request-driven — every distinct SourceRef a caller supplies binds another graph — so a host exposed to untrusted callers must also set maxSources. The retained total is then at most budgetBytes × (author datasets + maxSources).

        • OptionalmaxSources?: number

          Cap on sources resolved through the source registry, LRU — the request-driven half of the host's footprint. runAsync binds a graph per distinct SourceRef, and a caller chooses the refs, so without a cap an untrusted caller grows the host without bound. Author-added datasets (add) are never evicted by this. Unbounded when omitted — acceptable only when every SourceRef the host will see comes from code the author controls.

        • registry: Registry
        • Optionalsources?: SourceRegistry
        • Optionalunits?: Readonly<Record<string, string>>

      Returns Host

    Properties

    registry: Registry

    Accessors

    Methods

    • Registers a dataset. The graph is built lazily on first use, so seeding many datasets is cheap.

      Parameters

      • id: string
      • series: TimeSeries<SeriesSchema>

      Returns this

    • Forgets a dataset: its source, its graph, and every cached node value with them. The explicit end of a binding's lifecycle — the counterpart to add for a host that cycles datasets, where "kept until the process dies" is not a policy.

      Returns whether the dataset was known. A load in flight for the same source id discards its result rather than resurrecting the removed dataset — its runAsync callers get UnknownDatasetError, which is what asking for a concurrently-removed dataset means.

      Parameters

      • id: string

      Returns boolean

    • Resolves either a preloaded dataset or an opaque asynchronous source.

      Equal revisions preserve the graph untouched. A changed revision updates its source in place, retaining compiled nodes while normal invalidation propagates from the new value.

      Parameters

      Returns Promise<RunResult>