Mobus.Stepwise.Pipeline.Stepwise (mobus_stepwise v0.2.0)

Copy Markdown View Source

Static ALF pipeline for stepwise workflows.

This pipeline interprets the compiled spec (IR) in-band; we do not generate dynamic pipeline modules for disk-loaded workflows.

The stage order is defined in Mobus.Stepwise.SpecHelpers.pipeline_stage_modules/0 — both the foundation and workflow_stem pipelines reference the same list.

Summary

Functions

alf_components()

call(event, opts \\ [debug: false])

@spec call(any(), Keyword.t()) :: any() | [any()] | nil
@spec call(any(), Keyword.t()) :: reference()

cast(event, opts \\ [debug: false, send_result: false])

components()

@spec components() :: [map()]

ensure_started(opts \\ [])

@spec ensure_started(keyword()) :: :ok | {:error, term()}

Ensures the ALF pipeline process is running, starting it if necessary.

Checks if the pipeline process is registered. If not, starts it with the given options. Supports sync: true for deterministic test execution.

Parameters

  • opts — keyword list passed to the pipeline's start/1 callback (injected by use ALF.DSL). Common options:
    • :sync — when true, pipeline runs synchronously (useful for tests)

Returns

  • :ok — pipeline is running
  • {:error, reason} — pipeline failed to start

Examples

:ok = Stepwise.ensure_started(sync: true)

flow(flow, names, opts \\ [debug: false])

@spec flow(map(), list(), Keyword.t()) :: Enumerable.t()

start()

@spec start() :: :ok

start(opts)

@spec start(list()) :: :ok

started?()

@spec started?() :: true | false

stop()

@spec stop() :: :ok | {:exit, {atom(), any()}}

stream(stream, opts \\ [debug: false])

@spec stream(Enumerable.t(), Keyword.t()) :: Enumerable.t()