Skip to main content

Class: IngestionPipeline

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:124

Turns ingested events into entity updates, in every scene bound to it, according to one or more EventMappings.

This is the whole data layer, with no dependency on an Agent, a Transport or a session: you bind scenes to it and push events in. That makes IngestionPipeline.ingest the primary verb of the SDK's data module — a mapping can be exercised from a test, a webhook, a REST handler or a replay tool without a broker anywhere in sight:

const pipeline = new IngestionPipeline({ mappings });
pipeline.bind({ scene });
await pipeline.ingest({ channel: "uagv/v2/m/AGV-1/visualization", payload });

For each event: pick the matching mappings; per mapping, (opt.) validate the payload against its schema, call its updates function to get one entity update or several — then, in each bound scene, resolve every id to an entity (found or spawned per the mapping's entities) and apply its update, skipping redundant component writes.

To drive the scenes an Agent is attached to, and to feed the pipeline from a transport, use SceneIngestion — it owns a pipeline and binds/unbinds sessions for you.

Constructors

Constructor

new IngestionPipeline(__namedParameters: IngestionPipelineOptions): IngestionPipeline;

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:171

Parameters

ParameterType
__namedParametersIngestionPipelineOptions

Returns

IngestionPipeline

Throws

If no mapping is given, or a mapping is malformed — its entities declaring none of the four strategies, or its updates not being a function. Both are unreachable from TypeScript; they are what a JavaScript consumer gets instead of a compile error.

Accessors

stats

Get Signature

get stats(): IngestionStats | null;

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:195

What the pipeline has done so far — events in, updates out, and why anything was dropped. null when the pipeline was built with stats: false.

Returns

IngestionStats | null


boundSceneCount

Get Signature

get boundSceneCount(): number;

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:205

The number of scenes currently bound.

Returns

number

Methods

bind()

bind(__namedParameters: {
scene: Scene;
}): PipelineBinding;

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:216

Attach a scene: ingested events start driving its entities. Each scene gets its own resolvers, because a resolution (and its cache) is only meaningful against one scene.

Binding the same scene twice returns two independent bindings; unbind the one you no longer want.

Parameters

ParameterType
__namedParameters{ scene: Scene; }
__namedParameters.sceneScene

Returns

PipelineBinding


unbindAll()

unbindAll(): void;

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:245

Detach every bound scene.

Returns

void


ingest()

ingest(event: IngestEvent): Promise<void>;

Defined in: livelink.clients/livelink.agent/sources/data/IngestionPipeline.ts:257

Push one event through the pipeline: every mapping whose selectors match it drives the entities it addresses, in every bound scene.

Never throws — a mapping that throws is reported to onError and the stream continues.

Parameters

ParameterType
eventIngestEvent

Returns

Promise<void>