use dagrs::{EmptyAction, InChannels, Node, NodeTable, OutChannels, auto_node, dependencies};
#[auto_node]
struct MyNode {}
impl MyNode {
fn new(name: &str, node_table: &mut NodeTable) -> Self {
Self {
id: node_table.alloc_id_for(name),
name: name.to_string(),
input_channels: InChannels::default(),
output_channels: OutChannels::default(),
action: Box::new(EmptyAction),
}
}
}
#[tokio::main]
async fn main() -> Result<(), dagrs::DagrsError> {
let mut node_table = NodeTable::default();
let node_name = "auto_node";
let s = MyNode::new(node_name, &mut node_table);
let a = MyNode::new(node_name, &mut node_table);
let b = MyNode::new(node_name, &mut node_table);
let mut g = dependencies!(
s -> a b,
b -> a
)?;
g.async_start().await?;
Ok(())
}