Skip to main content

Type Alias: IngestionPipelineOptions

type IngestionPipelineOptions = {
mappings: EventMapping | EventMapping[];
validate?: boolean;
stats?: boolean;
onError?: (error: Error) => void;
manage_auto_broadcast?: boolean;
};

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

Options for an IngestionPipeline.

Properties

mappings

mappings: EventMapping | EventMapping[];

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

The mapping(s) describing how events drive entities. An event is handled by every mapping whose channel / when selectors match it.


validate?

optional validate?: boolean;

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

Validate every event against the schema of the mappings that declare one (requires the optional ajv dependency). Off by default: only the first matching event of each such mapping is validated; full per-event validation is a debugging tool.


stats?

optional stats?: boolean;

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

Count what the pipeline does, readable through IngestionPipeline.stats. On by default: the counting path allocates nothing and costs a handful of integer increments, well under what a single component write already costs, and the no_binding / no_mapping_matched / unresolved_entity breakdown is the only thing that tells "the stream is not arriving" apart from "nothing is listening yet" and "no mapping wants it".

Set it to false for the very highest-frequency streams; stats then reports null.


onError?

optional onError?: (error: Error) => void;

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

Called when a mapping's updates function throws or returns something unusable, or when an entity write fails. Ingestion continues — one bad event does not stop the stream.

Parameters

ParameterType
errorError

Returns

void


manage_auto_broadcast?

optional manage_auto_broadcast?: boolean;

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

On by default: the first time the pipeline resolves or spawns an entity for an id, it sets entity.auto_broadcast = false — the entity is being driven by this stream, so it should not re-broadcast those writes to other clients. Set to false to leave auto_broadcast untouched and manage it yourself, e.g. through a spawn template's options.auto_broadcast, or directly on entities found by byName / byUuid / resolve.