Skip to main content

Type Alias: SceneIngestionOptions

type SceneIngestionOptions = {
agent: Agent;
pipeline: IngestionPipeline;
sources?: IngestionSource[];
ticksPerSecond?: number;
};

Defined in: livelink.clients/livelink.agent/sources/data/SceneIngestion.ts:97

Options for a SceneIngestion.

Properties

agent

agent: Agent;

Defined in: livelink.clients/livelink.agent/sources/data/SceneIngestion.ts:104

The (pre-built, not-yet-started) agent to drive. SceneIngestion owns its start/stop; do not start it yourself. Built by the caller so its attachment policy (mode, watch, leave-on-condition) stays the caller's choice — mode: "join-all" for many sessions, mode: "join-or-start" for a single shared session.


pipeline

pipeline: IngestionPipeline;

Defined in: livelink.clients/livelink.agent/sources/data/SceneIngestion.ts:121

The mapping engine driving the scenes, built by the caller:

pipeline: new IngestionPipeline({ mappings, onError });

Always the caller's to build, so it can be unit-tested on its own, shared between ingestions, fed from somewhere else as well, and — the reason it is not sugar here — so its onError always reaches the caller, whoever constructed it.

Errors split by layer: the pipeline's own onError reports a mapping that throws or an entity write that fails; this object's on-error event reports a source that fails to start or an underlying agent error. Point both at the same handler for one channel.


sources?

optional sources?: IngestionSource[];

Defined in: livelink.clients/livelink.agent/sources/data/SceneIngestion.ts:135

The upstream data sources, as TransportSpecs or factories.

Started lazily, when the first session becomes ready, and shared by every session (one subscription, one timeline). Until then — and again once every session is gone — nothing is subscribed and events that would have arrived are simply not received; the pipeline counts anything that does arrive with no scene bound under the no_binding drop reason.

Optional: events can be pushed straight in with SceneIngestion.ingest, and any transport can be pointed at the ingestion itself (it is a EventSink), in which case you own that transport's lifecycle.


ticksPerSecond?

optional ticksPerSecond?: number;

Defined in: livelink.clients/livelink.agent/sources/data/SceneIngestion.ts:154

How often per second to advance the pipeline's continuous updates — the mappings that returned a continuous update rather than a patch, because what they were told was a rate.

Defaults to twice the agent's headless_client.updatesPerSecond (60 when it declares none). Not once: the two timers free-run and beat against each other, so ticking at exactly the flush rate lets the age of the sample at flush time wander across a whole flush window and the motion jitters. Set it to 0 to run no clock at all and call IngestionPipeline.tick yourself, from your own loop.

The clock starts with the sources, on the first ready session, and stops again when the last session goes — so a process with nothing bound is not left holding a timer. It costs nothing while no mapping has installed a continuation.

Throws

RangeError unless it is 0 or a finite rate in the (0, 125] range — the same rule updatesPerSecond follows, since both end up in a setInterval.