Emits a runtime-compiled ALF pipeline module from a spec's compiled descriptors.
Takes descriptors produced by WorkflowStem.Compiler.components_for/1
plus the spec's :routing table, and generates an Elixir module that:
- does
use ALF.DSL - exposes
@components [...]matching the descriptor list - carries
defdelegateentries for every routing name, so ALF'sswitch/gotocomponents resolve viaapply(pipeline_mod, name, args)
The generated module is compiled into the current BEAM via
Code.compile_quoted/1. Callers get back {:ok, module_name}; the
module is callable immediately.
Typical usage:
{:ok, mod} =
WorkflowStem.Pipeline.Builder.build(
MyAgent.Pipeline.SomeWorkflow,
Compiler.components_for(spec),
Map.get(spec, :routing, %{})
)
:ok = mod.start()
result = mod.call(event)Scope in this iteration
AST emission is implemented for all ALF DSL primitives: stage, switch,
composer, goto, goto_point, done, dead_end, from, plug_with,
and tbd.
Summary
Functions
Build and compile a pipeline module. Returns {:ok, module} on success.
Functions
Build and compile a pipeline module. Returns {:ok, module} on success.
Raises ArgumentError if a descriptor has no AST emitter.