Raxol. Workflow. Compiled
(Raxol v2.6.0)
View Source
Frozen, validated workflow ready for execution.
Returned by Raxol.Workflow.Graph.compile/2. The struct is opaque
in the sense that consumers should not construct or pattern-match on
its fields directly; the runtime API exposed here is the supported
interface.
Runtime entry points
invoke/3-- synchronous execution.async_invoke/3-- spawn a run in a separate process and return a{:ok, %{run_id, pid, ref}}handle.stream_events/3-- lazyCloudEventstream of run progress.resume/4-- consume an interrupt, continue from the checkpointed step.async_resume/4-- async variant ofresume/4.resume_events/4-- streaming variant ofresume/4.
Summary
Functions
Spawn the run in a background process; return an immediate handle.
Spawn a resume in a background process; return an immediate handle.
Run the compiled graph synchronously.
Resume an interrupted run.
Return a lazy Stream of Raxol.Core.Events.CloudEvent structs
emitted by the resume invocation.
Return a lazy Stream of Raxol.Core.Events.CloudEvent structs
emitted by the run.
Types
@type opts() :: %{ optional(:failure_policy) => :retry | :halt | :compensate, optional(:max_attempts) => pos_integer(), optional(:retry_backoff_ms) => non_neg_integer(), optional(:step_timeout_ms) => non_neg_integer(), optional(:run_timeout_ms) => non_neg_integer(), optional(:saver) => module() }
@type t() :: %Raxol.Workflow.Compiled{ channels: %{required(atom() | binary()) => Raxol.Workflow.Channel.t()}, edges_by_source: %{ required(Raxol.Workflow.Node.id()) => [Raxol.Workflow.Edge.t()] }, id: atom() | binary(), joins_by_node: %{ required(Raxol.Workflow.Node.id()) => Raxol.Workflow.Edge.JoinEdge.t() }, joins_by_upstream: %{ required(Raxol.Workflow.Node.id()) => Raxol.Workflow.Edge.JoinEdge.t() }, nodes: %{required(Raxol.Workflow.Node.id()) => Raxol.Workflow.Node.t()}, opts: opts() }
Functions
@spec async_invoke(t(), any(), keyword()) :: {:ok, %{run_id: binary(), pid: pid(), ref: reference()}}
Spawn the run in a background process; return an immediate handle.
Delegates to Raxol.Workflow.Async.async_invoke/3. See that module
for the returned handle shape and the supported opts.
@spec async_resume(t(), binary(), any(), keyword()) :: {:ok, %{run_id: binary(), pid: pid(), ref: reference()}} | {:error, :no_saver_configured | :no_checkpoint, nil}
Spawn a resume in a background process; return an immediate handle.
Delegates to Raxol.Workflow.Async.async_resume/4.
@spec invoke(t(), any(), keyword()) :: Raxol.Workflow.Runtime.result()
Run the compiled graph synchronously.
Delegates to Raxol.Workflow.Runtime.invoke/3. See that module for
the full result-tuple contract and the supported opts.
@spec resume(t(), binary(), any(), keyword()) :: Raxol.Workflow.Runtime.result() | {:error, :no_saver_configured | :no_checkpoint, nil}
Resume an interrupted run.
Delegates to Raxol.Workflow.Runtime.resume/4. See that module for
the full result-tuple contract and error tuples.
@spec resume_events(t(), binary(), any(), keyword()) :: Enumerable.t()
Return a lazy Stream of Raxol.Core.Events.CloudEvent structs
emitted by the resume invocation.
Delegates to Raxol.Workflow.Async.resume_events/4.
@spec stream_events(t(), any(), keyword()) :: Enumerable.t()
Return a lazy Stream of Raxol.Core.Events.CloudEvent structs
emitted by the run.
Delegates to Raxol.Workflow.Async.stream_events/3.