Struct steno::DagBuilder
source · pub struct DagBuilder { /* private fields */ }
Expand description
Used to build a Dag
that can then be executed as either a saga or
subsaga
Use DagBuilder::append()
and DagBuilder::append_parallel()
to add
nodes to the graph. Use DagBuilder::build()
to finish construction and
build a Dag
.
Implementations§
source§impl DagBuilder
impl DagBuilder
sourcepub fn new(saga_name: SagaName) -> DagBuilder
pub fn new(saga_name: SagaName) -> DagBuilder
Begin building a DAG for a saga or subsaga
sourcepub fn append(&mut self, user_node: Node)
pub fn append(&mut self, user_node: Node)
Adds a new node to the graph to be run after the most-recently-appended node(s)
The new node will depend on completion of all actions that were added in
the last call to append
or append_parallel
. The idea is to append
a sequence of steps that run one after another.
sourcepub fn append_parallel(&mut self, user_nodes: Vec<Node>)
pub fn append_parallel(&mut self, user_nodes: Vec<Node>)
Adds a set of nodes to the graph that depend on the most-recently-appended node(s) but that can be executed concurrently with each other
The new nodes will individually depend on completion of all actions that
were added in the last call to append()
or append_parallel()
.
sourcepub fn build(self) -> Result<Dag, DagBuilderError>
pub fn build(self) -> Result<Dag, DagBuilderError>
Return the constructed DAG