Skip to content

Plan

Defined in: plan/plan.ts:52

Compiled, immutable execution plan.

Created by Planner.compile(). Execute with run(plan, ctx).

The Plan is immutable and can be reused across multiple executions. It contains:

  • The AST defining the computation graph
  • Injectors mapping emit nodes to their runtime behavior
const plan = new Planner()
.in(load({ name: 'test' }))
.emit((out, $) => out.add('result', $.get('name').string()))
.compile()
// Plan can be executed multiple times
const result1 = await run(plan)
const result2 = await run(plan)

Out

The output type this plan produces

new Plan<Out>(ast, injectors): Plan<Out>

Defined in: plan/plan.ts:65

Create a new Plan.

PlanAst

The compiled AST structure

Map<NodeId, RuntimeInject> = ...

Map of node IDs to their runtime injectors

Plan<Out>

readonly ast: PlanAst

Defined in: plan/plan.ts:67

The abstract syntax tree defining the computation graph


readonly injectors: Map<NodeId, RuntimeInject>

Defined in: plan/plan.ts:69

Map of emit node IDs to their runtime injection functions