Oi. Flowgraph
(oi v0.6.0)
Copy Markdown
Summary
Functions
DSL entry point. Initialises an empty graph and evaluates the body, returning the fully built graph.
Add a step to the accumulated graph.
Connect two node ports.
Functions
@spec add_step(Oi.Topology.Graph.t(), module(), keyword()) :: Oi.Topology.Graph.t()
DSL entry point. Initialises an empty graph and evaluates the body, returning the fully built graph.
Example
iex> import Oi.Flowgraph
iex> graph = graph do
...> step OiTest.DummyOiStep.Greet
...> step OiTest.DummyOiStep.Exclaim
...> greet.greeting ~> exclaim.text
...> end
iex> map_size(graph.nodes)
2
iex> MapSet.size(graph.edges)
1
Add a step to the accumulated graph.
The module must use Oi.Step (i.e. expose __node_spec__/0).
Validated at compile time — raises ArgumentError if the module
does not implement the expected contract.
Options
:as— node alias (default: module's declared name):opts— keyword list forwarded as step options
Connect two node ports.
Both sides accept two forms:
node.port— dot-expression{node, port}— explicit tuple