Crates.io | rgraph |
lib.rs | rgraph |
version | 0.2.2 |
source | src |
created_at | 2017-12-08 18:57:35.627832 |
updated_at | 2019-06-12 18:52:57.138965 |
description | A task graph library. |
homepage | https://github.com/luisAyuso/rgraph.git |
repository | https://github.com/luisAyuso/rgraph.git |
max_upload_size | |
id | 42181 |
size | 54,312 |
A task graph, runs tasks defined by dependencies.
This library provides the mechanisms to define a directed acyclic graph of tasks. Once the graph is generated, a solver object can be instantiated to execute any of the tasks defined. In order to satisfy the input of such task, all the producer tasks will be executed as well.
A task can be defined like you would define a function, it requires:
The macro create_node!
will help you out with this task:
create_node!(
task_name (a: u32, b : u32) -> (output: u32) {
// return is done by assigning to the output variable
output = a + b;
}
)
The body of the task will be executed by a move lambda, this enforces some guarantees. Nevertheless if the tasks need to execute some side effects, you may keep in mind that:
Once the tasks are defined, you can bind the input assets to the output produced by other task or feed directly into the Solver.
g.bind_asset("task1::out_asset", "task2::in_asset").unwrap()
Automatic graph order deduction from graph description
Cacheable runs: if no input changed between runs, the node will no be executed.
Dot printer, pretty useful for debug purposes