Skip to main content

Interface: Registry

Defined in: packages/core/src/graph/registry.ts:68

Methods

clear()

clear(): void

Defined in: packages/core/src/graph/registry.ts:120

Drop all entries. Pending waiters stay pending (they'll be resolved if a record arrives later, or leak — callers are expected to abandon the runtime around clear()).

Returns

void


getOutcome()

getOutcome(nodeId, sourceRowId): NodeOutcome<unknown> | undefined

Defined in: packages/core/src/graph/registry.ts:112

Lookup without waiting. Returns undefined if not yet recorded.

Parameters

nodeId

string

sourceRowId

string

Returns

NodeOutcome<unknown> | undefined


hasOutcome()

hasOutcome(nodeId, sourceRowId): boolean

Defined in: packages/core/src/graph/registry.ts:115

True iff an outcome has been recorded for (nodeId, sourceRowId).

Parameters

nodeId

string

sourceRowId

string

Returns

boolean


record()

record(nodeId, sourceRowId, outcome): void

Defined in: packages/core/src/graph/registry.ts:77

Record a node's outcome for a specific row. Resolves any outstanding waitFor or waitForAll promises referencing this (node, row) pair.

Throws if an outcome was already recorded for this key — each node is expected to run exactly once per row. Double-record signals a runner bug we want to catch early rather than silently overwrite.

Parameters

nodeId

string

sourceRowId

string

outcome

NodeOutcome

Returns

void


waitFor()

waitFor(nodeId, sourceRowId): Promise<NodeOutcome<unknown>>

Defined in: packages/core/src/graph/registry.ts:83

Wait until an outcome is recorded for (nodeId, sourceRowId). If one is already present, resolves on the microtask queue.

Parameters

nodeId

string

sourceRowId

string

Returns

Promise<NodeOutcome<unknown>>


waitForAll()

waitForAll(sourceRowId, predecessorIds): Promise<WaitAllResult>

Defined in: packages/core/src/graph/registry.ts:106

Wait for EVERY predecessor in predecessorIds to record an outcome for sourceRowId, then return the aggregated result.

If all emitted: returns { kind: 'all-emitted', outputs } with outputs in predecessor-list order.

If any dropped: returns { kind: 'dropped', droppedAt, reason } with droppedAt being the first dropped predecessor in list order, and reason being that predecessor's SkipReason. The caller (runner) decides how to cascade — typically by recording its own dropped outcome with a derived reason.

Importantly, this method WAITS for every predecessor, even after a drop has been observed. A predecessor whose result would otherwise be ignored may still have downstream consumers that DON'T depend on the dropped branch — we don't want to leave those waiters hanging.

Zero-predecessor is a valid call (used by source nodes); resolves immediately with empty outputs.

Parameters

sourceRowId

string

predecessorIds

readonly string[]

Returns

Promise<WaitAllResult>